[pve-devel] [PATCH manager 2/2] show ha error state in tree and resource grid

Dominik Csapak d.csapak at proxmox.com
Tue Oct 25 12:24:24 CEST 2016


with this patch, vms in an ha error state get an icon (reusing the node
offline icon) to indicate the error

in the resource grid, we also add the icon, and have an additional
column where we can display the ha state

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Utils.js              | 5 +++++
 www/manager6/data/ResourceStore.js | 7 +++++++
 www/manager6/tree/ResourceTree.js  | 5 +++++
 3 files changed, 17 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 0932664..463a546 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -961,6 +961,11 @@ Ext.define('PVE.Utils', { utilities: {
 	    }
 	}
 
+	// overwrite anything else
+	if (record.data.hastate === 'error') {
+	    gridcls = '-offline';
+	}
+
 	var fa = '<i class="fa fa-fw x-fa-grid' + gridcls  +  ' fa-' + icon  + '"></i> ';
 	return fa + value;
     },
diff --git a/www/manager6/data/ResourceStore.js b/www/manager6/data/ResourceStore.js
index cc68b84..9147626 100644
--- a/www/manager6/data/ResourceStore.js
+++ b/www/manager6/data/ResourceStore.js
@@ -233,6 +233,13 @@ Ext.define('PVE.data.ResourceStore', {
 		hidden: true,
 		sortable: true,
 		width: 110
+	    },
+	    hastate: {
+		header: gettext('HA State'),
+		type: 'string',
+		defaultValue: '',
+		hidden: true,
+		sortable: true
 	    }
 	};
 
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index ac487c6..101604e 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -124,6 +124,11 @@ Ext.define('PVE.tree.ResourceTree', {
 		iconClsAdd = '-offline';
 	    }
 
+	    // overwrite any other class
+	    if (info.hastate === 'error') {
+		iconClsAdd = '-offline';
+	    }
+
 	    info.iconCls = defaults.iconCls + iconClsAdd;
 
 	    if (info.template) {
-- 
2.1.4





More information about the pve-devel mailing list