mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 11:33:50 +00:00
ui: ha: calculate service name in model to fix sorting
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
966a5de348
commit
105e575681
@ -145,16 +145,7 @@ Ext.define('PVE.ha.ResourcesView', {
|
|||||||
header: gettext('Name'),
|
header: gettext('Name'),
|
||||||
width: 100,
|
width: 100,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'sid',
|
dataIndex: 'vname',
|
||||||
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'),
|
||||||
|
@ -72,7 +72,21 @@ Ext.define('PVE.ha.StatusView', {
|
|||||||
'id', 'type', 'node', 'status', 'sid',
|
'id', 'type', 'node', 'status', 'sid',
|
||||||
'state', 'group', 'comment',
|
'state', 'group', 'comment',
|
||||||
'max_restart', 'max_relocate', 'type',
|
'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'
|
idProperty: 'id'
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user