[pve-devel] [PATCH widget-toolkit 3/5] vlan edit: Move example from default value to tooltip

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


We usually choose default values that are valid input for the field.
interfaceX.1 is rejected by the API.

Instead, use a tooltip to demonstrate possible valid inputs for the field.

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

diff --git a/src/node/NetworkEdit.js b/src/node/NetworkEdit.js
index 35edc31..9e56360 100644
--- a/src/node/NetworkEdit.js
+++ b/src/node/NetworkEdit.js
@@ -246,6 +246,10 @@ Ext.define('Proxmox.node.NetworkEdit', {
 	    value: me.iface,
 	    vtype: iface_vtype,
 	    allowBlank: false,
+	    autoEl: {
+		tag: 'div',
+		 'data-qtip': gettext('For example, vmbr0.100, vmbr0, vlan0.100, vlan0'),
+	    },
 	    listeners: {
 		change: function(f, value) {
 		    if (me.isCreate && iface_vtype === 'VlanName') {
diff --git a/src/node/NetworkView.js b/src/node/NetworkView.js
index 886b8de..4805636 100644
--- a/src/node/NetworkView.js
+++ b/src/node/NetworkView.js
@@ -235,7 +235,6 @@ Ext.define('Proxmox.node.NetworkView', {
 		    let win = Ext.create('Proxmox.node.NetworkEdit', {
 			nodename: me.nodename,
 			iftype: 'vlan',
-			iface_default: 'interfaceX.1',
 			onlineHelp: 'sysadmin_network_configuration',
 		    });
 		    win.on('destroy', reload);
-- 
2.20.1





More information about the pve-devel mailing list