Remove the group selector from the Resources grid view and edit window and replace it with the 'failback' field if the use-location-rules feature flag is enabled.
Signed-off-by: Daniel Kral <d.k...@proxmox.com> --- changes since v1: - NEW! www/manager6/ha/ResourceEdit.js | 27 ++++++++++++++++++++++----- www/manager6/ha/Resources.js | 7 +++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/www/manager6/ha/ResourceEdit.js b/www/manager6/ha/ResourceEdit.js index 1048ccca..f900db62 100644 --- a/www/manager6/ha/ResourceEdit.js +++ b/www/manager6/ha/ResourceEdit.js @@ -12,6 +12,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', { delete values.vmid; PVE.Utils.delete_if_default(values, 'group', '', me.isCreate); + PVE.Utils.delete_if_default(values, 'failback', '1', me.isCreate); PVE.Utils.delete_if_default(values, 'max_restart', '1', me.isCreate); PVE.Utils.delete_if_default(values, 'max_relocate', '1', me.isCreate); @@ -109,11 +110,6 @@ Ext.define('PVE.ha.VMResourceInputPanel', { ]; me.column2 = [ - { - xtype: 'pveHAGroupSelector', - name: 'group', - fieldLabel: gettext('Group'), - }, { xtype: 'proxmoxKVComboBox', name: 'state', @@ -138,6 +134,26 @@ Ext.define('PVE.ha.VMResourceInputPanel', { disabledHint, ]; + if (me.showGroups) { + me.column2.unshift({ + xtype: 'pveHAGroupSelector', + name: 'group', + fieldLabel: gettext('Group'), + }); + } else { + me.column2.push({ + xtype: 'proxmoxcheckbox', + name: 'failback', + fieldLabel: gettext('Failback'), + autoEl: { + tag: 'div', + 'data-qtip': gettext('Enable if service should be on highest priority node.'), + }, + uncheckedValue: 0, + value: 1, + }); + } + me.columnB = [ { xtype: 'textfield', @@ -177,6 +193,7 @@ Ext.define('PVE.ha.VMResourceEdit', { isCreate: me.isCreate, vmid: me.vmid, guestType: me.guestType, + showGroups: me.showGroups, }); Ext.apply(me, { diff --git a/www/manager6/ha/Resources.js b/www/manager6/ha/Resources.js index e8e53b3b..6f09a714 100644 --- a/www/manager6/ha/Resources.js +++ b/www/manager6/ha/Resources.js @@ -14,6 +14,11 @@ Ext.define('PVE.ha.ResourcesView', { throw 'no store given'; } + me.showGroups = true; + PVE.Utils.getHALocationFeatureStatus().then((isHALocationEnabled) => { + me.showGroups = !isHALocationEnabled; + }); + Proxmox.Utils.monStoreErrors(me, me.rstore); let store = Ext.create('Proxmox.data.DiffStore', { rstore: me.rstore, @@ -42,6 +47,7 @@ Ext.define('PVE.ha.ResourcesView', { destroy: () => me.rstore.load(), }, autoShow: true, + showGroups: me.showGroups, }); }; @@ -63,6 +69,7 @@ Ext.define('PVE.ha.ResourcesView', { destroy: () => me.rstore.load(), }, autoShow: true, + showGroups: me.showGroups, }); }, }, -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel