Close #1161: add hint when disabling a ha resource

Disabling a HA resource/service means that this
ressource will always be turned off.
However some users though this disabling HA management
for this VM, see
http://pve.proxmox.com/pipermail/pve-user/2016-October/011024.html

so we had a hint after clicking on the 'disable' checkbox, that
the checkbox is meant for shutdown
This commit is contained in:
Emmanuel Kasper 2016-10-19 14:17:43 +02:00 committed by Dietmar Maurer
parent aeae272a86
commit 390b85553a

View File

@ -1,7 +1,6 @@
Ext.define('PVE.ha.VMResourceInputPanel', {
extend: 'PVE.panel.InputPanel',
vmid: undefined,
onGetValues: function(values) {
@ -33,6 +32,14 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
initComponent : function() {
var me = this;
var disabledHint = Ext.createWidget({
xtype: 'displayfield', //submitValue is false, so we don't get submitted
userCls: 'pve-hint',
value: gettext('Disabling the resource will stop the guest system. ' +
'See the online help for details.'),
hidden: true
});
me.column1 = [
{
xtype: me.vmid ? 'displayfield' : 'pveVMIDSelector',
@ -56,8 +63,21 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
name: 'enable',
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('enable')
}
fieldLabel: gettext('enable'),
listeners: {
'change': function(field, newValue) {
if (newValue === false) {
disabledHint.setVisible(true);
}
else {
if (disabledHint.isVisible()) {
disabledHint.setVisible(false);
}
}
}
}
},
disabledHint
];
me.columnB = [