]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/ha/StatusView.js
ui: ha: calculate service name in model to fix sorting
[pve-manager.git] / www / manager6 / ha / StatusView.js
index ec5fc98e4b202aa0ddbe70da0c342c3465bc56ef..2e8fc5598c21a949f478833d6a954cd4702f4c48 100644 (file)
@@ -72,7 +72,21 @@ Ext.define('PVE.ha.StatusView', {
            'id', 'type', 'node', 'status', 'sid',
            'state', 'group', 'comment',
            'max_restart', 'max_relocate', 'type',
-           'crm_state', 'request_state'
+           'crm_state', 'request_state',
+           {
+               name: 'vname',
+               convert: function(value, record) {
+                   let sid = record.data.sid;
+                   if (!sid) return '';
+
+                   let res = sid.match(/^(\S+):(\S+)$/);
+                   if (res[1] !== 'vm' && res[1] !== 'ct') {
+                       return '-';
+                   }
+                   let vmid = res[2];
+                   return PVE.data.ResourceStore.guestName(vmid);
+               },
+           },
        ],
        idProperty: 'id'
     });