Add support for intel E and P cores (#107)
This commit is contained in:
parent
c90c2028fd
commit
14b2ee607e
@ -521,7 +521,7 @@ Ext.define('PVE.mod.TempHelper', {\n\
|
||||
cpuKeys.forEach((cpuKey, cpuIndex) => {\n\
|
||||
let cpuTemps = [];\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\
|
||||
try {\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\
|
||||
}\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\
|
||||
tempIndex = tempIndex[1];\n\
|
||||
tempStr = \`\${cpuTempCaption} \${tempIndex}: <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} \${tempIndex}: <span style=\"\${tempStyle}\">\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}</span>\`;\n\
|
||||
} else {\n\
|
||||
tempStr = \`\${cpuTempCaption}: \${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}: <span style=\"\${tempStyle}\">\${Ext.util.Format.number(tempVal, formatTemp)}\${cpuTempHelper.getUnit()}</span>\`;\n\
|
||||
}\n\
|
||||
cpuTemps.push(tempStr);\n\
|
||||
}\n\
|
||||
|
||||
Loading…
Reference in New Issue
Block a user