show ha error state in tree and resource grid

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-10-25 14:12:23 +02:00 committed by Dietmar Maurer
parent b67dc872ac
commit 2b2fe160f5
3 changed files with 19 additions and 1 deletions

View File

@ -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;
},

View File

@ -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
}
};

View File

@ -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) {
@ -288,7 +293,8 @@ Ext.define('PVE.tree.ResourceTree', {
if ((item.data.text !== olditem.data.text) ||
(item.data.running !== olditem.data.running) ||
(item.data.template !== olditem.data.template) ||
(item.data.status !== olditem.data.status)) {
(item.data.status !== olditem.data.status) ||
(item.data.hastate!== olditem.data.hastate)) {
//console.log("changed node/text/running " + olditem.data.id);
changed = true;
}