-
Notifications
You must be signed in to change notification settings - Fork 11
/
proxmoxlib.js.patch
49 lines (42 loc) · 1.5 KB
/
proxmoxlib.js.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js b/../proxmoxlib.js
index 91bf878..134f5cd 100644
--- a/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
+++ b/../proxmoxlib.js
@@ -1027,40 +1027,44 @@ utilities: {
if (!Ext.isNumeric(value)) {
return '';
}
return Proxmox.Utils.format_size(value);
},
render_cpu_model: function(cpu) {
let socketText = cpu.sockets > 1 ? gettext('Sockets') : gettext('Socket');
return `${cpu.cpus} x ${cpu.model} (${cpu.sockets.toString()} ${socketText})`;
},
/* this is different for nodes */
render_node_cpu_usage: function(value, record) {
return Proxmox.Utils.render_cpu_usage(value, record.cpus);
},
render_node_size_usage: function(record) {
return Proxmox.Utils.render_size_usage(record.used, record.total);
},
+ render_node_temp: function(record) {
+ return record.used.toFixed(1) + '°C (crit: ' + record.total.toFixed(1) + '°C)';
+ },
+
loadTextFromFile: function(file, callback, maxBytes) {
let maxSize = maxBytes || 8192;
if (file.size > maxSize) {
Ext.Msg.alert(gettext('Error'), gettext("Invalid file size: ") + file.size);
return;
}
let reader = new FileReader();
reader.onload = evt => callback(evt.target.result);
reader.readAsText(file);
},
parsePropertyString: function(value, defaultKey) {
var res = {},
error;
if (typeof value !== 'string' || value === '') {
return res;
}
Ext.Array.each(value.split(','), function(p) {