]> git.proxmox.com Git - pve-manager.git/commitdiff
show ha error state in tree and resource grid
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 25 Oct 2016 12:12:23 +0000 (14:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 28 Oct 2016 07:35:05 +0000 (09:35 +0200)
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>
www/manager6/Utils.js
www/manager6/data/ResourceStore.js
www/manager6/tree/ResourceTree.js

index 09326641b579f331efad21a7d3bb374638ac525d..463a546a9fb8db0cd0e5036045e2f9eb0471892d 100644 (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;
     },
index cc68b8457133badab72b0f6bfa6f8157936a9910..9147626cd95b0e00af33dc3640ece33ceba883ff 100644 (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
            }
        };
 
index ac487c6c30adf7ba6d75fd6dfe78000fb9a550a5..5cca7cefbe00b96d42b64285fe0046be55d56aa3 100644 (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;
                        }