[pve-devel] [PATCH pve-manager 3/3] ext6migrate: fix display of sport/dport/proto combo boxes

Emmanuel Kasper e.kasper at proxmox.com
Mon Feb 15 09:23:00 CET 2016


setting the field value of to '' would trigger
the 'change' event which would then disable
the sport/dport/proto comboboxes too early, an empty
form would have the comboboxes disabled too

instead keep the field to a null value if it is empty, but force
it to '' before sending to the pve-proxy

also makes the macro selector keyboard editable, similar to
the other comboboxes in the input panel
---
 www/manager6/grid/FirewallRules.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 371fc41..f03ceb9 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -58,7 +58,7 @@ Ext.define('PVE.FirewallRulePanel', {
 	// hack: editable ComboGrid returns nothing when empty, so we need to set ''
 	// Also, disabled text fields return nothing, so we need to set ''
 
-	Ext.Array.each(['source', 'dest', 'proto', 'sport', 'dport'], function(key) {
+	Ext.Array.each(['source', 'dest', 'macro', 'proto', 'sport', 'dport'], function(key) {
 	    if (values[key] === undefined) {
 		values[key] = '';
 	    }
@@ -161,12 +161,12 @@ Ext.define('PVE.FirewallRulePanel', {
 	    {
 		xtype: 'pveFWMacroSelector',
 		name: 'macro',
-		value: '',
 		fieldLabel: gettext('Macro'),
+		editable: true,
 		allowBlank: true,
 		listeners: {
 		    change: function(f, value) {
-                        if (value === '') {
+                        if (value === null) {
 			    me.down('field[name=proto]').setDisabled(false);
 			    me.down('field[name=sport]').setDisabled(false);
 			    me.down('field[name=dport]').setDisabled(false);
-- 
2.1.4





More information about the pve-devel mailing list