pve-manager/www/manager6/form/AgentFeatureSelector.js
Stoiko Ivanov 3f33951bb0 ui/qemu: Extend Qemu Guest agent
Change to agent now being a property_string, and including  fstrim_cloned_disks.

Co-Authored-By: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-08-02 16:20:12 +02:00

45 lines
1023 B
JavaScript

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);
}
}
}
},
{
xtype: 'proxmoxcheckbox',
boxLabel: gettext('Run guest-trim after clone disk'),
name: 'fstrim_cloned_disks',
disabled: true
}
];
me.callParent();
},
onGetValues: function(values) {
var agentstr = PVE.Parser.printPropertyString(values, 'enabled');
return { agent: agentstr };
},
setValues: function(values) {
var agent = values.agent || '';
var res = PVE.Parser.parsePropertyString(agent, 'enabled');
this.callParent([res]);
}
});