[pve-devel] [PATCH manager 3/6] add a new status column in the resourcestore

Dominik Csapak d.csapak at proxmox.com
Thu Apr 27 12:17:31 CEST 2017


we already got a status for vms/ct, but now we can also have one for
nodes and storages

if we do not get a status update for a node/storage (e.g. pvestatd hangs)
we now get the status 'unknown'

this is empty by default

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/data/ResourceStore.js | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/www/manager6/data/ResourceStore.js b/www/manager6/data/ResourceStore.js
index e655eaa7..af043fbf 100644
--- a/www/manager6/data/ResourceStore.js
+++ b/www/manager6/data/ResourceStore.js
@@ -240,6 +240,35 @@ Ext.define('PVE.data.ResourceStore', {
 		defaultValue: 'unmanaged',
 		hidden: true,
 		sortable: true
+	    },
+	    status: {
+		header: gettext('Status'),
+		type: 'string',
+		convert: function(value, record) {
+		    var info = record.data;
+		    var text = '';
+
+		    // for lxc and qemu we get a status from the backend
+		    if (value) {
+			return value;
+		    }
+
+		    if (info.type === 'lxc' ||
+			info.type === 'qemu') {
+			text = 'unknown';
+		    } else if (info.type === 'node') {
+			if (info.online !== undefined && !info.online) {
+			    text = 'offline';
+			} else {
+			    text = (info.uptime)?'online':'unknown';
+			}
+		    } else if (info.type === 'storage') {
+			if (!info.active) {
+			    text = 'unknown';
+			}
+		    }
+		    return text;
+		}
 	    }
 	};
 
-- 
2.11.0





More information about the pve-devel mailing list