]>
Commit | Line | Data |
---|---|---|
a5c093b1 | 1 | Ext.define('PVE.node.StatusView', { |
cb892fb3 DC |
2 | extend: 'PVE.panel.StatusView', |
3 | alias: 'widget.pveNodeStatus', | |
a5c093b1 | 4 | |
cb892fb3 | 5 | height: 300, |
7ec884ca | 6 | bodyPadding: '20 15 20 15', |
a5c093b1 | 7 | |
701acf20 DC |
8 | layout: { |
9 | type: 'table', | |
10 | columns: 2, | |
11 | tableAttrs: { | |
12 | style: { | |
13 | width: '100%' | |
14 | } | |
15 | } | |
16 | }, | |
17 | ||
cb892fb3 DC |
18 | defaults: { |
19 | xtype: 'pveInfoWidget', | |
701acf20 | 20 | padding: '0 15 5 15' |
cb892fb3 | 21 | }, |
a5c093b1 | 22 | |
cb892fb3 | 23 | items: [ |
cb892fb3 DC |
24 | { |
25 | itemId: 'cpu', | |
3ff9bf5a | 26 | iconCls: 'fa fa-fw pve-itype-icon-processor pve-icon', |
cb892fb3 DC |
27 | title: gettext('CPU usage'), |
28 | valueField: 'cpu', | |
29 | maxField: 'cpuinfo', | |
30 | renderer: PVE.Utils.render_node_cpu_usage | |
31 | }, | |
32 | { | |
33 | itemId: 'wait', | |
3ff9bf5a | 34 | iconCls: 'fa fa-fw fa-clock-o', |
cb892fb3 | 35 | title: gettext('IO delay'), |
701acf20 DC |
36 | valueField: 'wait', |
37 | rowspan: 2 | |
cb892fb3 DC |
38 | }, |
39 | { | |
40 | itemId: 'load', | |
3ff9bf5a | 41 | iconCls: 'fa fa-fw fa-tasks', |
cb892fb3 DC |
42 | title: gettext('Load average'), |
43 | printBar: false, | |
44 | textField: 'loadavg' | |
45 | }, | |
46 | { | |
47 | xtype: 'box', | |
701acf20 | 48 | colspan: 2, |
cb892fb3 DC |
49 | padding: '0 0 20 0' |
50 | }, | |
51 | { | |
3ff9bf5a | 52 | iconCls: 'fa fa-fw pve-itype-icon-memory pve-icon', |
cb892fb3 DC |
53 | itemId: 'memory', |
54 | title: gettext('RAM usage'), | |
55 | valueField: 'memory', | |
56 | maxField: 'memory', | |
57 | renderer: PVE.Utils.render_node_size_usage | |
58 | }, | |
59 | { | |
60 | itemId: 'ksm', | |
61 | printBar: false, | |
62 | title: gettext('KSM sharing'), | |
63 | textField: 'ksm', | |
64 | renderer: function(record) { | |
65 | return PVE.Utils.render_size(record.shared); | |
66 | }, | |
7ec884ca | 67 | padding: '0 15 10 15' |
cb892fb3 DC |
68 | }, |
69 | { | |
3ff9bf5a | 70 | iconCls: 'fa fa-fw fa-hdd-o', |
cb892fb3 DC |
71 | itemId: 'rootfs', |
72 | title: gettext('HD space') + '(root)', | |
73 | valueField: 'rootfs', | |
74 | maxField: 'rootfs', | |
75 | renderer: PVE.Utils.render_node_size_usage | |
76 | }, | |
77 | { | |
3ff9bf5a | 78 | iconCls: 'fa fa-fw fa-refresh', |
cb892fb3 DC |
79 | itemId: 'swap', |
80 | printSize: true, | |
81 | title: gettext('SWAP usage'), | |
82 | valueField: 'swap', | |
83 | maxField: 'swap', | |
84 | renderer: PVE.Utils.render_node_size_usage | |
85 | }, | |
86 | { | |
87 | xtype: 'box', | |
701acf20 | 88 | colspan: 2, |
cb892fb3 DC |
89 | padding: '0 0 20 0' |
90 | }, | |
91 | { | |
92 | itemId: 'cpus', | |
701acf20 | 93 | colspan: 2, |
cb892fb3 | 94 | printBar: false, |
4198e16f | 95 | title: gettext('CPU(s)'), |
cb892fb3 DC |
96 | textField: 'cpuinfo', |
97 | renderer: function(cpuinfo) { | |
98 | return cpuinfo.cpus + " x " + cpuinfo.model + " (" + | |
99 | cpuinfo.sockets.toString() + " " + | |
49e19905 DC |
100 | (cpuinfo.sockets > 1 ? |
101 | gettext('Sockets') : | |
102 | gettext('Socket') | |
103 | ) + ")"; | |
cb892fb3 | 104 | }, |
701acf20 | 105 | value: '' |
cb892fb3 DC |
106 | }, |
107 | { | |
108 | itemId: 'kversion', | |
701acf20 | 109 | colspan: 2, |
cb892fb3 DC |
110 | title: gettext('Kernel Version'), |
111 | printBar: false, | |
112 | textField: 'kversion', | |
701acf20 | 113 | value: '' |
cb892fb3 DC |
114 | }, |
115 | { | |
116 | itemId: 'version', | |
701acf20 | 117 | colspan: 2, |
cb892fb3 DC |
118 | printBar: false, |
119 | title: gettext('PVE Manager Version'), | |
120 | textField: 'pveversion', | |
701acf20 | 121 | value: '' |
cb892fb3 DC |
122 | } |
123 | ], | |
a5c093b1 | 124 | |
cb892fb3 DC |
125 | updateTitle: function() { |
126 | var me = this; | |
e7ade592 | 127 | var uptime = Proxmox.Utils.render_uptime(me.getRecordValue('uptime')); |
cb892fb3 | 128 | me.setTitle(me.pveSelNode.data.node + ' (' + gettext('Uptime') + ': ' + uptime + ')'); |
a5c093b1 | 129 | } |
cb892fb3 | 130 | |
a5c093b1 | 131 | }); |