diff --git a/index.html b/index.html index 4e30871..e74e47f 100644 --- a/index.html +++ b/index.html @@ -30,136 +30,9 @@
- - -
-- - -
-+ + +
+ `; + } + } +} + /** * Will create a nodes from an html string. * @param {string} str An html string @@ -350,35 +421,6 @@ function reApplyPeriodically(seconds) { document.reapplyLoop = setInterval(applyRyzenSettings, seconds * 1000); } -/** - * Display tooltip on each options. - */ -function displayOptionData() { - const options_data = require('./js/options_data.json'); - for (const option in options_data) { - if (options_data.hasOwnProperty(option)) { - const label = options_data[option].label; - const description = options_data[option].description; - const min = options_data[option].min; - const max = options_data[option].max; - const default_value = options_data[option].default; - - const title_container = document.getElementById(option).parentElement.parentElement.previousElementSibling; - const title = title_container.getElementsByClassName('option-label'); - const inputs = title_container.nextElementSibling.getElementsByTagName('input'); - title_container.setAttribute('uk-tooltip', description); - UIkit.tooltip(title_container); - title[0].innerHTML = label; - - for (const input of inputs) { - input.setAttribute('min', min); - input.setAttribute('max', max); - input.value = default_value; - } - } - } -} - /** * Will recreate shortcut on launch ... no other solution for now :( */ @@ -412,28 +454,15 @@ function recreateShortcut() { */ function getCurrentSettings(keyType) { if (keyType === "ryzenadjArgs") { - const optionToId = { - "--psi0-current=": 'psi0_current_limit', - "--stapm-time=": 'stapm_time_ms', - "--stapm-limit=": 'stapm_limit_w', - "--fast-limit=": 'ppt_fast_limit_w', - "--slow-limit=": 'ppt_slow_limit_w', - "--tctl-temp=": 'temperature_limit_c', - "--vrmmax-current=": 'vrm_current_m_a', - "--min-fclk-frequency=": 'min_fclk_frequency', - "--max-fclk-frequency=": 'max_fclk_frequency', - "--min-gfxclk=": 'min_gfxclk_frequency', - "--max-gfxclk=": 'max_gfxclk_frequency', - "--min-socclk-frequency=": 'min_socclk_frequency', - "--max-socclk-frequency=": 'max_socclk_frequency', - }; + const options_data = require('./js/options_data.json'); var settingsToBeUsed = {}; - for (const option in optionToId) { - if (optionToId.hasOwnProperty(option)) { - const elementId = optionToId[option]; + for (const elementId in options_data) { + if (options_data.hasOwnProperty(elementId)) { + const optionData = options_data[elementId]; + const ryzenadjArg = optionData.ryzenadj_arg; if (document.getElementById('apply_' + elementId).checked) { - settingsToBeUsed[option] = document.getElementById(elementId).value; + settingsToBeUsed[ryzenadjArg] = document.getElementById(elementId).value; } } } diff --git a/js/options_data.json b/js/options_data.json index a87ab2d..d6e6364 100644 --- a/js/options_data.json +++ b/js/options_data.json @@ -1,93 +1,145 @@ { - "psi0_current_limit": { - "description": "The limit of current we let the motherboard deliver to the PSI0.", - "label": "PSI0 Current Limit (mA)", - "min": "20", - "max": "100", - "default": "20" - }, "stapm_time_ms": { "description": "Skin Temperature Aware Power Management. This will define the boost period to be used.", "label": "STAPM Constant Time (Sec.)", + "tab": "controller", "min": "1", "max": "3600", - "default": "900" + "step": "1", + "default": "900", + "ryzenadj_arg": "--stapm-time=", + "ryzenadj_value_convert": "toThousand" }, "stapm_limit_w": { "description": "Skin Temperature Aware Power Management. This will define the socket power package limit which is used to manage the device boost period.", "label": "STAPM Limit (W)", + "tab": "controller", "min": "5", "max": "60", - "default": "20" + "step": "1", + "default": "20", + "ryzenadj_arg": "--stapm-limit=", + "ryzenadj_value_convert": "toThousand" }, "ppt_fast_limit_w": { "description": "The amount of power the CPU can draw while boost levels on.", "label": "PPT Fast Limit (W)", + "tab": "controller", "min": "5", "max": "60", - "default": "25" + "step": "1", + "default": "25", + "ryzenadj_arg": "--fast-limit=", + "ryzenadj_value_convert": "toThousand" }, "ppt_slow_limit_w": { "description": "The amount of power the CPU can draw while boost levels off.", "label": "PPT Slow Limit (W)", + "tab": "controller", "min": "5", "max": "60", - "default": "10" + "step": "1", + "default": "10", + "ryzenadj_arg": "--slow-limit=", + "ryzenadj_value_convert": "toThousand" }, "temperature_limit_c": { "description": "The temperature the CPU can reach before boost levels off.", "label": "Temperature Limit (°C)", + "tab": "controller", "min": "50", "max": "100", - "default": "75" + "step": "1", + "default": "75", + "ryzenadj_arg": "--tctl-temp=", + "ryzenadj_value_convert": false }, "vrm_current_m_a": { "description": "The limit of current we let the motherboard deliver to the CPU.", "label": "VRM Current (A)", + "tab": "controller", "min": "20", "max": "75", - "default": "30" - }, - "max_fclk_frequency": { - "description": "Fabric is AMD's marketing term for the bus connection that connects processor dies (GPU/CPU). This define the bus's max. clock limit.", - "label": "Maximum transmission frequency (Mhz)", - "min": "800", - "max": "1600", - "default": "1200" + "step": "1", + "default": "30", + "ryzenadj_arg": "--vrmmax-current=", + "ryzenadj_value_convert": "toHex" }, "min_fclk_frequency": { "description": "Fabric is AMD's marketing term for the bus connection that connects processor dies (GPU/CPU). This define the bus's min. clock limit.", "label": "Minimum transmission frequency (Mhz)", + "tab": "controller", "min": "800", "max": "1600", - "default": "800" + "step": "1", + "default": "800", + "ryzenadj_arg": "--min-fclk-frequency=", + "ryzenadj_value_convert": false }, - "max_gfxclk_frequency": { - "description": "The maximum clock speed the integrated GPU is allowed to run at.", - "label": "Maximum GFX Clock Frequency (Mhz)", - "min": "400", - "max": "1300", - "default": "1100" + "max_fclk_frequency": { + "description": "Fabric is AMD's marketing term for the bus connection that connects processor dies (GPU/CPU). This define the bus's max. clock limit.", + "label": "Maximum transmission frequency (Mhz)", + "tab": "controller", + "min": "800", + "max": "1600", + "step": "1", + "default": "1200", + "ryzenadj_arg": "--max-fclk-frequency=", + "ryzenadj_value_convert": false + }, + "psi0_current_limit": { + "description": "The limit of current we let the motherboard deliver to the PSI0.", + "label": "PSI0 Current Limit (mA)", + "tab": "experimental", + "min": "20", + "max": "100", + "step": "1", + "default": "20", + "ryzenadj_arg": "--psi0-current=", + "ryzenadj_value_convert": "toHex" }, "min_gfxclk_frequency": { "description": "The minimum clock speed the integrated GPU is allowed to run at.", "label": "Minimum GFX Clock Frequency (Mhz)", + "tab": "experimental", "min": "400", "max": "1300", - "default": "400" + "step": "1", + "default": "400", + "ryzenadj_arg": "--min-gfxclk=", + "ryzenadj_value_convert": "roundTen" }, - "max_socclk_frequency": { - "description": "The maximum clock speed the CPU is allowed to run at.", - "label": "Maximum SOC Clock Frequency (Mhz)", - "min": "200", - "max": "750", - "default": "600" + "max_gfxclk_frequency": { + "description": "The maximum clock speed the integrated GPU is allowed to run at.", + "label": "Maximum GFX Clock Frequency (Mhz)", + "tab": "experimental", + "min": "400", + "max": "1300", + "step": "1", + "default": "1100", + "ryzenadj_arg": "--max-gfxclk=", + "ryzenadj_value_convert": "roundTen" }, "min_socclk_frequency": { "description": "The minimum clock speed the CPU is allowed to run at.", "label": "Minimum SOC Clock Frequency (Mhz)", + "tab": "experimental", "min": "200", "max": "750", - "default": "200" + "step": "1", + "default": "200", + "ryzenadj_arg": "--min-socclk-frequency=", + "ryzenadj_value_convert": "roundTen" + }, + "max_socclk_frequency": { + "description": "The maximum clock speed the CPU is allowed to run at.", + "label": "Maximum SOC Clock Frequency (Mhz)", + "tab": "experimental", + "min": "200", + "max": "750", + "step": "1", + "default": "600", + "ryzenadj_arg": "--max-socclk-frequency=", + "ryzenadj_value_convert": "roundTen" } } diff --git a/package-lock.json b/package-lock.json index 0d2225e..5ac5378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,8 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true }, "ajv": { "version": "6.10.0", @@ -249,7 +250,8 @@ "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "optional": true }, "is-fullwidth-code-point": { "version": "2.0.0", @@ -272,6 +274,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "optional": true, "requires": { "ansi-regex": "^4.1.0" } @@ -864,7 +867,8 @@ "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "optional": true }, "end-of-stream": { "version": "1.4.1", @@ -1343,7 +1347,8 @@ "is-promise": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", - "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=" + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=", + "optional": true }, "is-stream": { "version": "1.1.0", @@ -1428,6 +1433,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "optional": true, "requires": { "graceful-fs": "^4.1.9" } @@ -1467,12 +1473,14 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "optional": true }, "lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "optional": true }, "lodash.get": { "version": "4.4.2", @@ -2102,6 +2110,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "optional": true, "requires": { "glob": "^7.1.3" } @@ -2140,6 +2149,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "optional": true, "requires": { "shebang-regex": "^1.0.0" } @@ -2147,7 +2157,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "optional": true }, "shell-env": { "version": "0.3.0", @@ -2570,7 +2581,8 @@ "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "optional": true }, "is-fullwidth-code-point": { "version": "2.0.0", @@ -2593,6 +2605,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "optional": true, "requires": { "ansi-regex": "^4.1.0" }