Re: [pve-devel] pve-devel Digest, Vol 167, Issue 233
--- Begin Message --- Certo Edoardo, nessun problema :-) Da: "undefined" A: "undefined" Inviato: lunedì 22 aprile 2024 12:00 Oggetto: pve-devel Digest, Vol 167, Issue 233 Send pve-devel mailing list submissions to pve-devel@lists.proxmox.com To subscribe or unsubscribe via the World Wide Web, visit https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel or, via email, send a message with subject or body 'help' to pve-devel-requ...@lists.proxmox.com You can reach the person managing the list at pve-devel-ow...@lists.proxmox.com When replying, please edit your Subject line so it is more specific than "Re: Contents of pve-devel digest..." Today's Topics: 1. Re: [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function (Dominik Csapak) 2. Re: [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit (Dominik Csapak) -- Message: 1 Date: Mon, 22 Apr 2024 11:33:46 +0200 From: Dominik Csapak To: Proxmox VE development discussion , Markus Frank Subject: Re: [pve-devel] [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function Message-ID: <2a004a96-fe68-41c0-94bd-4c6cea151...@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed one minor nit inline, otherwise Reviewed-by: Dominik Csapak Tested-by: Dominik Csapak On 4/8/24 12:33, Markus Frank wrote: > Signed-off-by: Markus Frank > --- > www/manager6/qemu/DisplayEdit.js | 57 ++-- > 1 file changed, 33 insertions(+), 24 deletions(-) > > diff --git a/www/manager6/qemu/DisplayEdit.js > b/www/manager6/qemu/DisplayEdit.js > index 9bb1763e..17b02ee4 100644 > --- a/www/manager6/qemu/DisplayEdit.js > +++ b/www/manager6/qemu/DisplayEdit.js > @@ -11,6 +11,33 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > return { vga: ret }; > }, > > + viewModel: { > + data: { > + type: '__default__', > + nonGUIOptionRegex: /^(serial\d|none)$/, > + }, > + formulas: { > + matchNonGUIOption: function(get) { > + return get('type').match(get('nonGUIOptionRegex')); since this regex is only used once, i'd inline it where it's used > + }, > + memoryEmptyText: function(get) { > + let val = get('type'); > + if (val === "cirrus") { > + return "4"; > + } else if (val === "std" || val.match(/^qxl\d?$/) || val === "vmware") { > + return "16"; > + } else if (val.match(/^virtio/)) { > + return "256"; > + } else if (get('matchNonGUIOption')) { > + return "N/A"; > + } else { > + console.debug("unexpected display type", val); > + return Proxmox.Utils.defaultText; > + } > + }, > + }, > + }, > + > items: [{ > name: 'type', > xtype: 'proxmoxKVComboBox', > @@ -27,39 +54,21 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > } > return true; > }, > - listeners: { > - change: function(cb, val) { > - if (!val) { > - return; > - } > - let memoryfield = this.up('panel').down('field[name=memory]'); > - let disableMemoryField = false; > - > - if (val === "cirrus") { > - memoryfield.setEmptyText("4"); > - } else if (val === "std" || val.match(/^qxl\d?$/) || val === "vmware") { > - memoryfield.setEmptyText("16"); > - } else if (val.match(/^virtio/)) { > - memoryfield.setEmptyText("256"); > - } else if (val.match(/^(serial\d|none)$/)) { > - memoryfield.setEmptyText("N/A"); > - disableMemoryField = true; > - } else { > - console.debug("unexpected display type", val); > - memoryfield.setEmptyText(Proxmox.Utils.defaultText); > - } > - memoryfield.setDisabled(disableMemoryField); > - }, > + bind: { > + value: '{type}', > }, > }, > { > xtype: 'proxmoxintegerfield', > - emptyText: Proxmox.Utils.defaultText, > fieldLabel: gettext('Memory') + ' (MiB)', > minValue: 4, > maxValue: 512, > step: 4, > name: 'memory', > + bind: { > + emptyText: '{memoryEmptyText}', > + disabled: '{matchNonGUIOption}', > + }, > }], > }); > -- Message: 2 Date: Mon, 22 Apr 2024 11:36:50 +0200 From: Dominik Csapak To: Proxmox VE development discussion , Markus Frank Subject: Re: [pve-devel] [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit Message-ID: <701654f9-5083-4d5b-891b-21202af94...@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed a few comments inline On 4/8/24 12:33, Markus Frank wrote: > For SPICE and VNC, a different message is displayed. > > The backend code for the clipboard option can be found in the > 'config: enable vnc clipboard parameter in vga_fmt'-commit in qemu-server. > > Signed-off-by: Markus Frank > --- > www/manager6/qemu/DisplayEdit.js | 41 > 1 file changed, 41 insertions(+) > > diff --git a/www/manager6/qemu/DisplayEdit.js > b/www/manager6/qemu/DisplayEdit.js > index 17b02ee4..3357794a 100644 > --- a/www/manager6/qemu/DisplayEdit.js > +++ b/www/manager6/qemu/DisplayEdit.js > @@ -15,6 +15,7 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > data: {
Re: [pve-devel] pve-devel Digest, Vol 167, Issue 233
--- Begin Message --- Ok, ottimo :-) Grazie Lucio Da: "undefined" A: "undefined" Inviato: lunedì 22 aprile 2024 12:00 Oggetto: pve-devel Digest, Vol 167, Issue 233 Send pve-devel mailing list submissions to pve-devel@lists.proxmox.com To subscribe or unsubscribe via the World Wide Web, visit https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel or, via email, send a message with subject or body 'help' to pve-devel-requ...@lists.proxmox.com You can reach the person managing the list at pve-devel-ow...@lists.proxmox.com When replying, please edit your Subject line so it is more specific than "Re: Contents of pve-devel digest..." Today's Topics: 1. Re: [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function (Dominik Csapak) 2. Re: [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit (Dominik Csapak) -- Message: 1 Date: Mon, 22 Apr 2024 11:33:46 +0200 From: Dominik Csapak To: Proxmox VE development discussion , Markus Frank Subject: Re: [pve-devel] [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function Message-ID: <2a004a96-fe68-41c0-94bd-4c6cea151...@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed one minor nit inline, otherwise Reviewed-by: Dominik Csapak Tested-by: Dominik Csapak On 4/8/24 12:33, Markus Frank wrote: > Signed-off-by: Markus Frank > --- > www/manager6/qemu/DisplayEdit.js | 57 ++-- > 1 file changed, 33 insertions(+), 24 deletions(-) > > diff --git a/www/manager6/qemu/DisplayEdit.js > b/www/manager6/qemu/DisplayEdit.js > index 9bb1763e..17b02ee4 100644 > --- a/www/manager6/qemu/DisplayEdit.js > +++ b/www/manager6/qemu/DisplayEdit.js > @@ -11,6 +11,33 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > return { vga: ret }; > }, > > + viewModel: { > + data: { > + type: '__default__', > + nonGUIOptionRegex: /^(serial\d|none)$/, > + }, > + formulas: { > + matchNonGUIOption: function(get) { > + return get('type').match(get('nonGUIOptionRegex')); since this regex is only used once, i'd inline it where it's used > + }, > + memoryEmptyText: function(get) { > + let val = get('type'); > + if (val === "cirrus") { > + return "4"; > + } else if (val === "std" || val.match(/^qxl\d?$/) || val === "vmware") { > + return "16"; > + } else if (val.match(/^virtio/)) { > + return "256"; > + } else if (get('matchNonGUIOption')) { > + return "N/A"; > + } else { > + console.debug("unexpected display type", val); > + return Proxmox.Utils.defaultText; > + } > + }, > + }, > + }, > + > items: [{ > name: 'type', > xtype: 'proxmoxKVComboBox', > @@ -27,39 +54,21 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > } > return true; > }, > - listeners: { > - change: function(cb, val) { > - if (!val) { > - return; > - } > - let memoryfield = this.up('panel').down('field[name=memory]'); > - let disableMemoryField = false; > - > - if (val === "cirrus") { > - memoryfield.setEmptyText("4"); > - } else if (val === "std" || val.match(/^qxl\d?$/) || val === "vmware") { > - memoryfield.setEmptyText("16"); > - } else if (val.match(/^virtio/)) { > - memoryfield.setEmptyText("256"); > - } else if (val.match(/^(serial\d|none)$/)) { > - memoryfield.setEmptyText("N/A"); > - disableMemoryField = true; > - } else { > - console.debug("unexpected display type", val); > - memoryfield.setEmptyText(Proxmox.Utils.defaultText); > - } > - memoryfield.setDisabled(disableMemoryField); > - }, > + bind: { > + value: '{type}', > }, > }, > { > xtype: 'proxmoxintegerfield', > - emptyText: Proxmox.Utils.defaultText, > fieldLabel: gettext('Memory') + ' (MiB)', > minValue: 4, > maxValue: 512, > step: 4, > name: 'memory', > + bind: { > + emptyText: '{memoryEmptyText}', > + disabled: '{matchNonGUIOption}', > + }, > }], > }); > -- Message: 2 Date: Mon, 22 Apr 2024 11:36:50 +0200 From: Dominik Csapak To: Proxmox VE development discussion , Markus Frank Subject: Re: [pve-devel] [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit Message-ID: <701654f9-5083-4d5b-891b-21202af94...@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed a few comments inline On 4/8/24 12:33, Markus Frank wrote: > For SPICE and VNC, a different message is displayed. > > The backend code for the clipboard option can be found in the > 'config: enable vnc clipboard parameter in vga_fmt'-commit in qemu-server. > > Signed-off-by: Markus Frank > --- > www/manager6/qemu/DisplayEdit.js | 41 > 1 file changed, 41 insertions(+) > > diff --git a/www/manager6/qemu/DisplayEdit.js > b/www/manager6/qemu/DisplayEdit.js > index 17b02ee4..3357794a 100644 > --- a/www/manager6/qemu/DisplayEdit.js > +++ b/www/manager6/qemu/DisplayEdit.js > @@ -15,6 +15,7 @@ Ext.define('PVE.qemu.DisplayInputPanel', { > data: { >