mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 12:29:49 +00:00
ui: ha: add name of service to resource grid
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
7bc5e7978d
commit
2ae20617aa
@ -38,6 +38,19 @@ Ext.define('PVE.data.ResourceStore', {
|
|||||||
return me.getAt(index).data.node;
|
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) {
|
constructor: function(config) {
|
||||||
// fixme: how to avoid those warnings
|
// fixme: how to avoid those warnings
|
||||||
/*jslint confusion: true */
|
/*jslint confusion: true */
|
||||||
|
@ -141,6 +141,21 @@ Ext.define('PVE.ha.ResourcesView', {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'crm_state'
|
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'),
|
header: gettext('Max. Restart'),
|
||||||
width: 100,
|
width: 100,
|
||||||
|
Loading…
Reference in New Issue
Block a user