[pve-devel] [PATCH manager v2 2/2] ui/qemu: Extend Qemu Guest agent

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Aug 2 16:36:06 CEST 2018


Am 08/01/2018 um 08:29 PM schrieb Stoiko Ivanov:
> Change to agent now being a property_string, and including  fstrim_cloned_disks.
> 
> Co-Authored-By: Thomas Lamprecht <t.lamprecht at proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---

answering your cover letter here, the added Co-Authored is totally fine, IMO! 

applied, thanks.

FYI, you could do this with statically schematic definition only:

/*jslint confusion: true*/
Ext.define('PVE.form.AgentFeatureSelector', {
    extend: 'Proxmox.panel.InputPanel',
    alias: ['widget.pveAgentFeatureSelector'],

    viewModel: {
        parent: null
    },

    items: [
        {
            xtype: 'proxmoxcheckbox',
            boxLabel: gettext('Qemu Agent'),
            name: 'enabled',
            reference: 'qga',
            uncheckedValue: 0
        },
        {
            xtype: 'proxmoxcheckbox',
            boxLabel: gettext('Run guest-trim after clone disk'),
            name: 'fstrim_cloned_disks',
            bind: {
                disabled: '{!qga.checked}'
            }
        }
    ],

    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]);
    }
});

see:
https://docs.sencha.com/extjs/6.0.2/guides/application_architecture/view_models_data_binding.html
for some information how/why this works, if you do not already know this :)
Just FYI, I kept your version.




More information about the pve-devel mailing list