ui: ha: add name of service to resource grid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-11-30 20:03:53 +01:00
parent 7bc5e7978d
commit 2ae20617aa
2 changed files with 28 additions and 0 deletions

View File

@ -38,6 +38,19 @@ Ext.define('PVE.data.ResourceStore', {
return me.getAt(index).data.node;
},
guestName: function(vmid) {
let me = this;
let index = me.findExact('vmid', parseInt(vmid, 10));
if (index < 0) {
return '-';
}
let rec = me.getAt(index).data;
if ('name' in rec) {
return rec.name;
}
return '';
},
constructor: function(config) {
// fixme: how to avoid those warnings
/*jslint confusion: true */

View File

@ -141,6 +141,21 @@ Ext.define('PVE.ha.ResourcesView', {
sortable: true,
dataIndex: 'crm_state'
},
{
header: gettext('Name'),
width: 100,
sortable: true,
dataIndex: 'sid',
renderer: function(value, metaData, record) {
let res = value.match(/^(\S+):(\S+)$/);
if (res[1] !== 'vm' && res[1] !== 'ct') {
return '-';
}
//var guestType = res[1];
let vmid = res[2];
return PVE.data.ResourceStore.guestName(vmid);
}
},
{
header: gettext('Max. Restart'),
width: 100,