[pve-devel] [PATCH widget-toolkit 5/5] vlan edit: Match explicit values to name field

Dominic Jäger d.jaeger at proxmox.com
Mon Feb 8 13:41:37 CET 2021


Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
 src/node/NetworkEdit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/node/NetworkEdit.js b/src/node/NetworkEdit.js
index 9e56360..d1ac454 100644
--- a/src/node/NetworkEdit.js
+++ b/src/node/NetworkEdit.js
@@ -258,8 +258,22 @@ Ext.define('Proxmox.node.NetworkEdit', {
 			if (Proxmox.Utils.VlanInterface_match.test(value)) {
 			    vlanidField.setDisabled(true);
 			    vlanrawdeviceField.setDisabled(true);
+			    // User defined those values in the `iface` (Name)
+			    // field. Match them (instead of leaving the
+			    // previous value) to make clear what is submitted
+			    // and how the fields `iface`, `vlan-id` and
+			    // `vlan-raw-device` are connected
+			    vlanidField.setValue(
+				value.match(Proxmox.Utils.VlanInterface_match)[2],
+			    );
+			    vlanrawdeviceField.setValue(
+				value.match(Proxmox.Utils.VlanInterface_match)[1],
+			    );
 			} else if (Proxmox.Utils.Vlan_match.test(value)) {
 			    vlanidField.setDisabled(true);
+			    vlanidField.setValue(
+				value.match(Proxmox.Utils.Vlan_match)[1],
+			    );
 			    vlanrawdeviceField.setDisabled(false);
 			} else {
 			    vlanidField.setDisabled(false);
-- 
2.20.1




More information about the pve-devel mailing list