Add support for intel E and P cores (#107)

This commit is contained in:
Meliox 2025-08-06 15:57:55 +02:00 committed by GitHub
parent c90c2028fd
commit 14b2ee607e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -521,7 +521,7 @@ Ext.define('PVE.mod.TempHelper', {\n\
cpuKeys.forEach((cpuKey, cpuIndex) => {\n\ cpuKeys.forEach((cpuKey, cpuIndex) => {\n\
let cpuTemps = [];\n\ let cpuTemps = [];\n\
const items = objValue[cpuKey];\n\ const items = objValue[cpuKey];\n\
const itemKeys = Object.keys(items).filter(item => { return String(item).startsWith(cpuItemPrefix); });\n\ const itemKeys = Object.keys(items).filter(item => { return String(item).includes(cpuItemPrefix); });\n\
itemKeys.forEach((coreKey) => {\n\ itemKeys.forEach((coreKey) => {\n\
try {\n\ try {\n\
let tempVal = NaN, tempMax = NaN, tempCrit = NaN;\n\ let tempVal = NaN, tempMax = NaN, tempCrit = NaN;\n\
@ -543,12 +543,19 @@ Ext.define('PVE.mod.TempHelper', {\n\
tempStyle = 'color: red; font-weight: bold;';\n\ tempStyle = 'color: red; font-weight: bold;';\n\
}\n\ }\n\
let tempStr = '';\n\ let tempStr = '';\n\
let tempIndex = coreKey.match(/\\\S+\\\s*(\\\d+)/);\n\ let tempIndex = coreKey.match(\/(?:P\\\s+Core|E\\\s+Core|Core)\\\s*(\\\d+)\/);\n\
if (tempIndex !== null && tempIndex.length > 1) {\n\ if (tempIndex !== null && tempIndex.length > 1) {\n\
tempIndex = tempIndex[1];\n\ tempIndex = tempIndex[1];\n\
tempStr = \`\${cpuTempCaption}&nbsp;\${tempIndex}:&nbsp;<span style=\"\${tempStyle}\">\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}</span>\`;\n\ let coreType = coreKey.startsWith('P Core') ? 'P Core' :\n\
coreKey.startsWith('E Core') ? 'E Core' :\n\
cpuTempCaption;\n\
tempStr = \`\${coreType}&nbsp;\${tempIndex}:&nbsp;<span style=\"\${tempStyle}\">\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}</span>\`;\n\
} else {\n\ } else {\n\
tempStr = \`\${cpuTempCaption}:&nbsp;\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}\`;\n\ // fallback for CPUs which do not have a core index\n\
let coreType = coreKey.startsWith('P Core') ? 'P Core' :\n\
coreKey.startsWith('E Core') ? 'E Core' :\n\
cpuTempCaption;\n\
tempStr = \`\${coreType}:&nbsp;<span style=\"\${tempStyle}\">\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}</span>\`;\n\
}\n\ }\n\
cpuTemps.push(tempStr);\n\ cpuTemps.push(tempStr);\n\
}\n\ }\n\