mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-09 17:06:16 +00:00
openvz: add bridge vlan && firewall options to gui
parse bridge= vmbrX(vY)?(f)? Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
dc34665afc
commit
85c2c7b97e
@ -159,7 +159,21 @@ Ext.define('PVE.Parser', { statics: {
|
|||||||
errors = true;
|
errors = true;
|
||||||
return false; // break
|
return false; // break
|
||||||
}
|
}
|
||||||
data[match_res[1]] = match_res[2];
|
if (match_res[1]==='bridge'){
|
||||||
|
var bridgevlanf = match_res[2];
|
||||||
|
var bridge_res = bridgevlanf.match(/^(vmbr(\d+))(v(\d+))?(f)?$/);
|
||||||
|
if (!bridge_res) {
|
||||||
|
errors = true;
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
data['bridge'] = bridge_res[1];
|
||||||
|
data['tag'] = bridge_res[4];
|
||||||
|
if(bridge_res[5]){
|
||||||
|
data['firewall'] = 1;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
data[match_res[1]] = match_res[2];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (errors || !data.ifname) {
|
if (errors || !data.ifname) {
|
||||||
@ -180,11 +194,21 @@ Ext.define('PVE.Parser', { statics: {
|
|||||||
|
|
||||||
Ext.Object.each(netif, function(iface, data) {
|
Ext.Object.each(netif, function(iface, data) {
|
||||||
var tmparray = [];
|
var tmparray = [];
|
||||||
Ext.Array.each(['ifname', 'mac', 'bridge', 'host_ifname' , 'host_mac', 'mac_filter'], function(key) {
|
Ext.Array.each(['ifname', 'mac', 'bridge', 'host_ifname' , 'host_mac', 'mac_filter', 'tag', 'firewall'], function(key) {
|
||||||
var value = data[key];
|
var value = data[key];
|
||||||
|
if(key === 'bridge'){
|
||||||
|
if(data['tag']){
|
||||||
|
value = value + 'v' + data['tag'];
|
||||||
|
}
|
||||||
|
if(data['firewall']){
|
||||||
|
value = value + 'f';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (value) {
|
if (value) {
|
||||||
tmparray.push(key + '=' + value);
|
tmparray.push(key + '=' + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
netarray.push(tmparray.join(','));
|
netarray.push(tmparray.join(','));
|
||||||
});
|
});
|
||||||
|
@ -82,6 +82,17 @@ Ext.define('PVE.OpenVZ.NetIfEdit', {
|
|||||||
value: cdata.bridge,
|
value: cdata.bridge,
|
||||||
allowBlank: false
|
allowBlank: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
xtype: 'pveVlanField',
|
||||||
|
name: 'tag',
|
||||||
|
value: cdata.tag,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'pvecheckbox',
|
||||||
|
fieldLabel: gettext('Firewall'),
|
||||||
|
name: 'firewall',
|
||||||
|
checked: cdata.firewall,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
name: 'host_ifname',
|
name: 'host_ifname',
|
||||||
@ -430,7 +441,7 @@ Ext.define('PVE.openvz.NetworkView', {
|
|||||||
Ext.define('pve-openvz-network', {
|
Ext.define('pve-openvz-network', {
|
||||||
extend: "Ext.data.Model",
|
extend: "Ext.data.Model",
|
||||||
proxy: { type: 'memory' },
|
proxy: { type: 'memory' },
|
||||||
fields: [ 'id', 'type', 'value', 'ifname', 'mac', 'bridge', 'host_ifname', 'host_mac' ]
|
fields: [ 'id', 'type', 'value', 'ifname', 'mac', 'bridge', 'host_ifname', 'host_mac', 'tag', 'firewall' ]
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user