feat: add temperature and network speed.

This commit is contained in:
2025-03-18 10:53:05 +08:00
parent 73647e3fad
commit dab566cc73
3 changed files with 45 additions and 2 deletions

View File

@ -44913,7 +44913,7 @@ Ext.define('PVE.node.StatusView', {
extend: 'Proxmox.panel.StatusView',
alias: 'widget.pveNodeStatus',
height: 350,
height: 390,
bodyPadding: '15 5 15 5',
layout: {
@ -45048,6 +45048,38 @@ Ext.define('PVE.node.StatusView', {
textField: 'pveversion',
value: '',
},
{
itemId: 'thermal',
colspan: 2,
printBar: false,
title: gettext('Thermal'),
textField: 'thermal',
renderer: function (value) {
if (!Array.isArray(value)) {
return '';
}
const temp = JSON.parse(value[0]);
const cpu0 = temp['coretemp-isa-0000']['Package id 0']['temp1_input'].toFixed(1);
// const board = temp['acpitz-acpi-0']['temp1']['temp1_input'].toFixed(1);
const nvme = temp['nvme-pci-0c00']['Composite']['temp1_input'].toFixed(1);
const gpu = Number(value[1]).toFixed(1);
return `CPU: ${cpu0}\xb0C | GPU: ${gpu}\xb0C | NVME: ${nvme}\xb0C`;
},
},
{
itemId: 'networksp',
colspan: 2,
printBar: false,
title: gettext('Network Speed'),
textField: 'networksp',
renderer: function (sp) {
if (!Array.isArray(sp)) {
return '';
}
const sps = sp.map(function (s) { return String(s).match(/(?<=:\s+)(.+)/g)?.[0] });
return sps.join(' | ');
},
},
],
updateTitle: function() {