diff --git a/index.html b/index.html index d618823..4e30871 100644 --- a/index.html +++ b/index.html @@ -31,76 +31,76 @@
@@ -110,49 +110,49 @@
diff --git a/js/app.js b/js/app.js index c918cfc..ec8c4d7 100644 --- a/js/app.js +++ b/js/app.js @@ -10,7 +10,7 @@ ready(function(){ checkForAdminRights(); displayVersion(); reApplyPeriodically(require('electron-settings').get('settings.reapply_periodically')); - displayOptionDescription(); + displayOptionData(); if (require('os').platform() === 'win32') { recreateShortcut(); } diff --git a/js/methods.js b/js/methods.js index beede3c..069b495 100644 --- a/js/methods.js +++ b/js/methods.js @@ -353,14 +353,28 @@ function reApplyPeriodically(seconds) { /** * Display tooltip on each options. */ -function displayOptionDescription() { - const options_description = require('./js/options_description.json'); - for (const option in options_description) { - if (options_description.hasOwnProperty(option)) { - const description = options_description[option]; - const node = document.getElementById(option).parentElement.parentElement.previousElementSibling; - node.setAttribute('uk-tooltip', description); - UIkit.tooltip(node); +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; + } } } } diff --git a/js/options_data.json b/js/options_data.json new file mode 100644 index 0000000..a87ab2d --- /dev/null +++ b/js/options_data.json @@ -0,0 +1,93 @@ +{ + "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.)", + "min": "1", + "max": "3600", + "default": "900" + }, + "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)", + "min": "5", + "max": "60", + "default": "20" + }, + "ppt_fast_limit_w": { + "description": "The amount of power the CPU can draw while boost levels on.", + "label": "PPT Fast Limit (W)", + "min": "5", + "max": "60", + "default": "25" + }, + "ppt_slow_limit_w": { + "description": "The amount of power the CPU can draw while boost levels off.", + "label": "PPT Slow Limit (W)", + "min": "5", + "max": "60", + "default": "10" + }, + "temperature_limit_c": { + "description": "The temperature the CPU can reach before boost levels off.", + "label": "Temperature Limit (°C)", + "min": "50", + "max": "100", + "default": "75" + }, + "vrm_current_m_a": { + "description": "The limit of current we let the motherboard deliver to the CPU.", + "label": "VRM Current (A)", + "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" + }, + "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)", + "min": "800", + "max": "1600", + "default": "800" + }, + "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" + }, + "min_gfxclk_frequency": { + "description": "The minimum clock speed the integrated GPU is allowed to run at.", + "label": "Minimum GFX Clock Frequency (Mhz)", + "min": "400", + "max": "1300", + "default": "400" + }, + "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" + }, + "min_socclk_frequency": { + "description": "The minimum clock speed the CPU is allowed to run at.", + "label": "Minimum SOC Clock Frequency (Mhz)", + "min": "200", + "max": "750", + "default": "200" + } +} diff --git a/js/options_description.json b/js/options_description.json deleted file mode 100644 index aeeaceb..0000000 --- a/js/options_description.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "psi0_current_limit": "The limit of current we let the motherboard deliver to the PSI0.", - "stapm_time_ms": "Skin Temperature Aware Power Management. This will define the boost period to be used.", - "stapm_limit_w": "Skin Temperature Aware Power Management. This will define the socket power package limit which is used to manage the device boost period.", - "ppt_fast_limit_w": "The amount of power the CPU can draw while boost levels on.", - "ppt_slow_limit_w": "The amount of power the CPU can draw while boost levels off.", - "temperature_limit_c": "The temperature the CPU can reach before boost levels off.", - "vrm_current_m_a": "The limit of current we let the motherboard deliver to the CPU.", - "max_fclk_frequency": "Fabric is AMD's marketing term for the bus connection that connects processor dies (GPU/CPU). This define the bus's max. clock limit.", - "min_fclk_frequency": "Fabric is AMD's marketing term for the bus connection that connects processor dies (GPU/CPU). This define the bus's min. clock limit.", - "max_gfxclk_frequency": "The maximum clock speed the integrated GPU is allowed to run at.", - "min_gfxclk_frequency": "The minimum clock speed the integrated GPU is allowed to run at.", - "max_socclk_frequency": "The maximum clock speed the CPU is allowed to run at.", - "min_socclk_frequency": "The minimum clock speed the CPU is allowed to run at." -}