From d92856d1928333180bcfb560789654257bddf8db Mon Sep 17 00:00:00 2001 From: rmm Date: Tue, 4 Jul 2023 19:47:15 +0200 Subject: [PATCH] CPU temperature indices follow the sensors output --- pve-mod-gui-temp.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pve-mod-gui-temp.sh b/pve-mod-gui-temp.sh index feac517..f7d99f8 100644 --- a/pve-mod-gui-temp.sh +++ b/pve-mod-gui-temp.sh @@ -218,11 +218,13 @@ function install_mod { const items = objValue[cpuAddress],\n\ itemKeys = Object.keys(items).filter(item => { return String(item).startsWith(cpuItemPrefix); });\n\ let temps = [];\n\ - itemKeys.forEach((coreKey, index) => {\n\ + itemKeys.forEach((coreKey) => {\n\ try {\n\ Object.keys(items[coreKey]).forEach((secondLevelKey) => {\n\ if (secondLevelKey.includes('_input')) {\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\ }\n\ })\n\