diff --git a/pve-mod-gui-temp.sh b/pve-mod-gui-temp.sh index 203270c..d2bb7fd 100644 --- a/pve-mod-gui-temp.sh +++ b/pve-mod-gui-temp.sh @@ -225,10 +225,17 @@ function install_mod { try {\n\ Object.keys(items[coreKey]).forEach((secondLevelKey) => {\n\ if (secondLevelKey.includes('_input')) {\n\ + let tempStr = '';\n\ let temp = items[coreKey][secondLevelKey];\n\ let index = coreKey.match(/\\\S+\\\s*(\\\d+)/);\n\ - index = (index !== null && index.length > 1) ? index[1] : '?';\n\ - temps.push(\`\${cpuTempCaption} \${index}: \${temp}°C\`);\n\ + if(index !== null && index.length > 1) {\n\ + index = index[1];\n\ + tempStr = \`\${cpuTempCaption} \${index}: \${temp}°C\`;\n\ + }\n\ + else {\n\ + tempStr = \`\${cpuTempCaption}: \${temp}°C\`;\n\ + }\n\ + temps.push(tempStr);\n\ }\n\ })\n\ } catch(e) { /*_*/ }\n\ @@ -412,4 +419,4 @@ done # If no arguments were provided or all arguments have been processed, print the usage message if [[ $executed -eq 0 ]]; then usage -fi \ No newline at end of file +fi