comestic : switch proto and interface in forms

for readability, better to have

macro
proto
src port
dest port

in same column

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2014-05-19 05:42:21 +02:00 committed by Dietmar Maurer
parent ad1072cd11
commit f6f18eed76

View File

@ -70,18 +70,27 @@ Ext.define('PVE.FirewallRulePanel', {
data: [['ACCEPT', 'ACCEPT'], ['DROP', 'DROP'], ['REJECT', 'REJECT']], data: [['ACCEPT', 'ACCEPT'], ['DROP', 'DROP'], ['REJECT', 'REJECT']],
fieldLabel: gettext('Action'), fieldLabel: gettext('Action'),
allowBlank: false allowBlank: false
}, }
{ ];
xtype: 'pveKVComboBox',
name: 'proto', if (me.allow_iface) {
value: '', me.column1.push({
xtype: 'pvetextfield',
name: 'iface',
deleteEmpty: !me.create, deleteEmpty: !me.create,
emptyText: 'any', value: '',
editable: true, fieldLabel: gettext('Interface')
data: [['tcp', 'TCP'], ['udp', 'UDP'], ['icmp', 'ICMP']], });
fieldLabel: gettext('Protocol'), } else {
allowBlank: true me.column1.push({
}, xtype: 'displayfield',
fieldLabel: '',
height: 22, // hack: set same height as text fields
value: ''
});
}
me.column1.push([
{ {
xtype: 'displayfield', xtype: 'displayfield',
fieldLabel: '', fieldLabel: '',
@ -106,7 +115,7 @@ Ext.define('PVE.FirewallRulePanel', {
value: '', value: '',
fieldLabel: gettext('Destination') fieldLabel: gettext('Destination')
} }
]; ]);
me.column2 = [ me.column2 = [
{ {
@ -124,27 +133,18 @@ Ext.define('PVE.FirewallRulePanel', {
deleteEmpty: !me.create, deleteEmpty: !me.create,
fieldLabel: gettext('Macro'), fieldLabel: gettext('Macro'),
allowBlank: true allowBlank: true
} },
]; {
xtype: 'pveKVComboBox',
if (me.allow_iface) { name: 'proto',
me.column2.push({
xtype: 'pvetextfield',
name: 'iface',
deleteEmpty: !me.create,
value: '', value: '',
fieldLabel: gettext('Interface') deleteEmpty: !me.create,
}); emptyText: 'any',
} else { editable: true,
me.column2.push({ data: [['tcp', 'TCP'], ['udp', 'UDP'], ['icmp', 'ICMP']],
xtype: 'displayfield', fieldLabel: gettext('Protocol'),
fieldLabel: '', allowBlank: true
height: 22, // hack: set same height as text fields },
value: ''
});
}
me.column2.push([
{ {
xtype: 'displayfield', xtype: 'displayfield',
fieldLabel: '', fieldLabel: '',
@ -164,7 +164,7 @@ Ext.define('PVE.FirewallRulePanel', {
value: '', value: '',
fieldLabel: gettext('Dest. port') fieldLabel: gettext('Dest. port')
} }
]); ];
me.columnB = [ me.columnB = [
{ {