* [pve-devel] [PATCH manager] ui: qemu pci edit: select correct radiobutton when editing
@ 2025-04-07 9:50 Dominik Csapak
2025-04-07 9:54 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-04-07 9:50 UTC (permalink / raw)
To: pve-devel
This panel uses a view model for changing between mapping and raw for
disabling fields. Since the view model bindings take effect after
setVMConfig is called, the default value for 'isMapped' of true
overwrote the mode chosen from the config.
To fix that, set the value in the view model there too.
Additionally, check the 'mapped' radiobutton by default instead of
'raw', so that it is the same as the view model.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/qemu/PCIEdit.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/www/manager6/qemu/PCIEdit.js b/www/manager6/qemu/PCIEdit.js
index 8f633cb6..fda41f50 100644
--- a/www/manager6/qemu/PCIEdit.js
+++ b/www/manager6/qemu/PCIEdit.js
@@ -9,6 +9,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
setVMConfig: function(vmconfig) {
let me = this;
let view = me.getView();
+ let vm = me.getViewModel();
me.vmconfig = vmconfig;
let hostpci = me.vmconfig[view.confid] || '';
@@ -26,6 +27,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
} else if (values.mapping) {
values.type = 'mapped';
}
+ vm.set('isMapped', values.type !== 'raw');
values['x-vga'] = PVE.Parser.parseBoolean(values['x-vga'], 0);
values.pcie = PVE.Parser.parseBoolean(values.pcie, 0);
@@ -180,6 +182,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
xtype: 'radiofield',
name: 'type',
inputValue: 'mapped',
+ checked: true,
boxLabel: gettext('Mapped Device'),
bind: {
value: '{isMapped}',
@@ -205,7 +208,6 @@ Ext.define('PVE.qemu.PCIInputPanel', {
xtype: 'radiofield',
name: 'type',
inputValue: 'raw',
- checked: true,
boxLabel: gettext('Raw Device'),
},
{
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH manager] ui: qemu pci edit: select correct radiobutton when editing
2025-04-07 9:50 [pve-devel] [PATCH manager] ui: qemu pci edit: select correct radiobutton when editing Dominik Csapak
@ 2025-04-07 9:54 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-04-07 9:54 UTC (permalink / raw)
To: pve-devel, Dominik Csapak
On Mon, 07 Apr 2025 11:50:29 +0200, Dominik Csapak wrote:
> This panel uses a view model for changing between mapping and raw for
> disabling fields. Since the view model bindings take effect after
> setVMConfig is called, the default value for 'isMapped' of true
> overwrote the mode chosen from the config.
>
> To fix that, set the value in the view model there too.
>
> [...]
Applied, thanks!
[1/1] ui: qemu pci edit: select correct radiobutton when editing
commit: 4ecd28022c77f0763a7b133005b9d3a6650508e9
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-07 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-07 9:50 [pve-devel] [PATCH manager] ui: qemu pci edit: select correct radiobutton when editing Dominik Csapak
2025-04-07 9:54 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal