[pve-devel] [PATCH manager 1/5] Add edit dialog for audio device

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 16 13:44:50 CEST 2019


On 7/15/19 3:34 PM, Aaron Lauterer wrote:
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
>  www/manager6/Makefile          |  1 +
>  www/manager6/qemu/AudioEdit.js | 61 ++++++++++++++++++++++++++++++++++
>  2 files changed, 62 insertions(+)
>  create mode 100644 www/manager6/qemu/AudioEdit.js
> 
> diff --git a/www/manager6/Makefile b/www/manager6/Makefile
> index 2ac48b94..7ee7cd40 100644
> --- a/www/manager6/Makefile
> +++ b/www/manager6/Makefile
> @@ -156,6 +156,7 @@ JSSRC= 				                 	\
>  	qemu/SSHKey.js					\
>  	qemu/IPConfigEdit.js				\
>  	qemu/SystemEdit.js				\
> +	qemu/AudioEdit.js				\
>  	lxc/Summary.js					\
>  	lxc/Network.js					\
>  	lxc/Resources.js				\
> diff --git a/www/manager6/qemu/AudioEdit.js b/www/manager6/qemu/AudioEdit.js
> new file mode 100644
> index 00000000..091db73f
> --- /dev/null
> +++ b/www/manager6/qemu/AudioEdit.js
> @@ -0,0 +1,61 @@
> +/*jslint confusion: true */

There's no jslint in 6.x, but I'd guess this comes from "copy-is-my-hobby" ;-)

> +Ext.define('PVE.qemu.AudioInputPanel', {
> +    extend: 'Proxmox.panel.InputPanel',
> +    xtype: 'pveAudioInputPanel',
> +
> +    onGetValues: function(values) {
> +	var ret = PVE.Parser.printPropertyString(values);
> +	console.log('audio ret: ');
> +	console.log(ret);

no (new) console logs, please remove them once you prepare changes for
submission.

> +	if (ret === '') {
> +	    return {
> +		'delete': 'audio0'
> +	    };
> +	}
> +	return {
> +	    audio0: ret
> +	};



> +    },
> +
> +    items: [{
> +	name: 'type',
> +	xtype: 'proxmoxKVComboBox',
> +	value: 'ich9-intel-hda',
> +	deleteEmpty: true,

makes deleteEmpty here sense if we have a fixed set of values,
which cannot get selected to ''?

> +	fieldLabel: gettext('Audio Device'),
> +	comboItems: [
> +	    ['ich9-intel-hda', 'ich9-intel-hda'],
> +	    ['intel-hda', 'intel-hda'],
> +	    ['AC97', 'AC97']
> +	]
> +    }]
> +});
> +
> +Ext.define('PVE.qemu.AudioEdit', {
> +    extend: 'Proxmox.window.Edit',
> +
> +    vmconfig: undefined,
> +
> +    subject: gettext('Audio Device'),
> +
> +    items: [{
> +	xtype: 'pveAudioInputPanel'
> +    }],
> +
> +    initComponent : function() {
> +	var me = this;
> +
> +	me.callParent();
> +
> +	me.load({
> +	    success: function(response) {
> +		me.vmconfig = response.result.data;
> +
> +		var audio0 = me.vmconfig.audio0;
> +		if (audio0) {
> +		    me.setValues(PVE.Parser.parsePropertyString(audio0));
> +		}
> +	    }
> +	});
> +    }
> +});
> 





More information about the pve-devel mailing list