ui: vm/qga selector: convert to schematic style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-10-08 14:41:05 +02:00
parent 8990d6da22
commit ffe0fbba9a

View File

@ -2,34 +2,26 @@ Ext.define('PVE.form.AgentFeatureSelector', {
extend: 'Proxmox.panel.InputPanel',
alias: ['widget.pveAgentFeatureSelector'],
initComponent: function() {
var me = this;
me.items= [
{
xtype: 'proxmoxcheckbox',
boxLabel: gettext('Qemu Agent'),
name: 'enabled',
uncheckedValue: 0,
listeners: {
change: function(f, value, old) {
var gtcb = me.down('proxmoxcheckbox[name=fstrim_cloned_disks]');
if (value) {
gtcb.setDisabled(false);
} else {
gtcb.setDisabled(true);
}
}
}
viewModel: {},
items: [
{
xtype: 'proxmoxcheckbox',
boxLabel: gettext('Qemu Agent'),
name: 'enabled',
reference: 'enabled',
uncheckedValue: 0,
},
{
xtype: 'proxmoxcheckbox',
boxLabel: gettext('Run guest-trim after clone disk'),
name: 'fstrim_cloned_disks',
bind: {
disabled: '{!enabled.checked}',
},
{
xtype: 'proxmoxcheckbox',
boxLabel: gettext('Run guest-trim after clone disk'),
name: 'fstrim_cloned_disks',
disabled: true
}
];
me.callParent();
},
disabled: true
}
],
onGetValues: function(values) {
var agentstr = PVE.Parser.printPropertyString(values, 'enabled');