[pve-devel] [PATCH 2/2] firewall edit rule : disable proto, sport, dport if macro is selected
Alexandre Derumier
aderumier at odiso.com
Mon May 19 05:42:22 CEST 2014
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
www/manager/grid/FirewallRules.js | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/www/manager/grid/FirewallRules.js b/www/manager/grid/FirewallRules.js
index b7a53fe..25ca444 100644
--- a/www/manager/grid/FirewallRules.js
+++ b/www/manager/grid/FirewallRules.js
@@ -132,7 +132,20 @@ Ext.define('PVE.FirewallRulePanel', {
value: '',
deleteEmpty: !me.create,
fieldLabel: gettext('Macro'),
- allowBlank: true
+ allowBlank: true,
+ listeners: {
+ change: function(f, value) {
+ if (value === '') {
+ me.down('field[name=proto]').setDisabled(false);
+ me.down('field[name=sport]').setDisabled(false);
+ me.down('field[name=dport]').setDisabled(false);
+ } else {
+ me.down('field[name=proto]').setDisabled(true);
+ me.down('field[name=sport]').setDisabled(true);
+ me.down('field[name=dport]').setDisabled(true);
+ }
+ }
+ }
},
{
xtype: 'pveKVComboBox',
--
1.7.10.4
More information about the pve-devel
mailing list