1、去订阅
需要修改文件/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
搜索关键字 checked_command 定位,if判断改成false即可
checked_command: function(orig_cmd) {
Proxmox.Utils.API2Request(
{
url: '/nodes/localhost/subscription',
method: 'GET',
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
success: function(response, opts) {
let res = response.result;
if (false) {
Ext.Msg.show({
title: gettext('No valid subscription'),
icon: Ext.Msg.WARNING,
message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
buttons: Ext.Msg.OK,
callback: function(btn) {
if (btn !== 'ok') {
return;
}
orig_cmd();
},
});
} else {
orig_cmd();
}
},
},
);
},
2、添加温度和频率显示
apt-get install lm-sensors
修改/usr/share/perl5/PVE/API2/Nodes.pm
在Nodes.pm中搜索pveversion,在这段代码下面加入
$res->{thermalstate} = `sensors -j`;
$res->{cpusensors} = `lscpu | grep MHz`;
在pvemanagerlib.js文件中也是搜索pveversion,在它这段代码下面加入
{
itemId: 'thermal',
colspan: 2,
printBar: false,
title: gettext('温度'),
textField: 'thermalstate',
renderer:function(value){
value = JSON.parse(value.replaceAll('Â', ''));
const c0 = value['coretemp-isa-0000']['Package id 0']['temp1_input'].toFixed(1);
const c1 = value['nvme-pci-0100']['Composite']['temp1_input'].toFixed(1);
const c2 = value['nvme-pci-0500']['Composite']['temp1_input'].toFixed(1);
const c3 = value['nvme-pci-0800']['Composite']['temp1_input'].toFixed(1);
return `CPU: ${c0}℃ | NVME0: ${c1}℃ | NVME1: ${c2}℃ | NVME2: ${c3}℃ `
}
},
{
itemId: 'MHz',
colspan: 2,
printBar: false,
title: gettext('CPU频率'),
textField: 'cpusensors',
renderer:function(value){
const f0 = value.match(/CPU MHz.*?([\d]+)/)[1];
const f1 = value.match(/CPU min MHz.*?([\d]+)/)[1];
const f2 = value.match(/CPU max MHz.*?([\d]+)/)[1];
return `CPU实时: ${f0} MHz | 最小: ${f1} MHz | 最大: ${f2} MHz `
}
},
3、重启web
systemctl restart pveproxy