]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/node/StatusView.js
1 Ext
.define('PVE.node.StatusView', {
2 extend
: 'Proxmox.panel.StatusView',
3 alias
: 'widget.pveNodeStatus',
7 subscriptionActive
: '',
8 noSubscriptionRepo
: '',
13 repoStatus: function(get) {
14 if (get('subscriptionActive') === '' ||
15 get('enterpriseRepo') === '') {
19 if (!get('subscriptionActive') && get('enterpriseRepo')) {
23 if (get('noSubscriptionRepo') || get('testRepo')) {
24 return 'non-production';
27 if (!get('enterpriseRepo') || !get('noSubscriptionRepo') || !get('testRepo')) {
33 repoStatusMessage: function(get) {
34 const status
= get('repoStatus');
36 if (status
=== 'ok') {
37 return gettext('Enterprise repository and subscription active');
38 } else if (status
=== 'no-sub') {
39 return gettext('Enterprise repository enabled, but no active subscription');
40 } else if (status
=== 'non-production') {
41 return gettext('No-subscription or test repository in use');
42 } else if (status
=== 'no-repo') {
43 return gettext('No PVE repository is enabled!');
46 return Proxmox
.Utils
.unknownText
;
48 repoStatusIconCls: function(get) {
49 const status
= get('repoStatus');
51 let iconCls
= (cls
) => `fa fa-fw ${cls}`;
53 if (status
=== 'ok') {
54 return iconCls('fa-check good');
55 } else if (status
=== 'no-sub') {
56 return iconCls('fa-exclamation-triangle critical');
57 } else if (status
=== 'non-production') {
58 return iconCls('fa-exclamation-triangle warning');
59 } else if (status
=== 'no-repo') {
60 return iconCls('fa-exclamation-triangle critical');
63 return iconCls('fa-question-circle-o');
69 bodyPadding
: '20 15 20 15',
82 xtype
: 'pmxInfoWidget',
89 iconCls
: 'fa fa-fw pmx-itype-icon-processor pmx-icon',
90 title
: gettext('CPU usage'),
93 renderer
: Proxmox
.Utils
.render_node_cpu_usage
,
97 iconCls
: 'fa fa-fw fa-clock-o',
98 title
: gettext('IO delay'),
104 iconCls
: 'fa fa-fw fa-tasks',
105 title
: gettext('Load average'),
107 textField
: 'loadavg',
115 iconCls
: 'fa fa-fw pmx-itype-icon-memory pmx-icon',
117 title
: gettext('RAM usage'),
118 valueField
: 'memory',
120 renderer
: Proxmox
.Utils
.render_node_size_usage
,
125 title
: gettext('KSM sharing'),
127 renderer: function(record
) {
128 return Proxmox
.Utils
.render_size(record
.shared
);
130 padding
: '0 15 10 15',
133 iconCls
: 'fa fa-fw fa-hdd-o',
135 title
: gettext('HD space') + '(root)',
136 valueField
: 'rootfs',
138 renderer
: Proxmox
.Utils
.render_node_size_usage
,
141 iconCls
: 'fa fa-fw fa-refresh',
144 title
: gettext('SWAP usage'),
147 renderer
: Proxmox
.Utils
.render_node_size_usage
,
158 title
: gettext('CPU(s)'),
159 textField
: 'cpuinfo',
160 renderer
: Proxmox
.Utils
.render_cpu_model
,
166 title
: gettext('Kernel Version'),
168 textField
: 'kversion',
175 title
: gettext('PVE Manager Version'),
176 textField
: 'pveversion',
180 itemId
: 'repositoryStatus',
183 title
: gettext('Repository Configuration Status'),
185 setValue: function(value
) {
187 me
.updateValue(value
);
190 iconCls
: '{repoStatusIconCls}',
191 value
: '{repoStatusMessage}',
196 updateTitle: function() {
198 var uptime
= Proxmox
.Utils
.render_uptime(me
.getRecordValue('uptime'));
199 me
.setTitle(me
.pveSelNode
.data
.node
+ ' (' + gettext('Uptime') + ': ' + uptime
+ ')');
202 setRepositoryInfo: function(standardRepos
) {
204 let vm
= me
.getViewModel();
206 for (const standardRepo
of standardRepos
) {
207 const handle
= standardRepo
.handle
;
208 const status
= standardRepo
.status
;
210 if (handle
=== "enterprise") {
211 vm
.set('enterpriseRepo', status
);
212 } else if (handle
=== "no-subscription") {
213 vm
.set('noSubscriptionRepo', status
);
214 } else if (handle
=== "test") {
215 vm
.set('testRepo', status
);
220 setSubscriptionStatus: function(status
) {
222 let vm
= me
.getViewModel();
224 vm
.set('subscriptionActive', status
);