mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-27 10:50:10 +03:00
Bug #1415: Fix VLAN option in Vnet templates
Currently VLAN was not set unless VLAN_ID was specified. This commit fixes it. It also shows the option for ebtables and hides VLAN_ID option for non-administrator users. (cherry picked from commit a74eea22fdf86c2bfc3d0b035e45522c63297626)
This commit is contained in:
parent
974300bdda
commit
98048f42f7
@ -74,7 +74,7 @@ var create_vn_tmpl =
|
||||
<input type="text" name="phydev" id="phydev" />\
|
||||
<label for="vlan">'+tr("VLAN")+':</label>\
|
||||
<select name="vlan" id="vlan">\
|
||||
<option value="YES">'+tr("Yes")+'</option>\
|
||||
<option value="YES" selected="selected">'+tr("Yes")+'</option>\
|
||||
<option value="NO">'+tr("No")+'</option>\
|
||||
</select><br />\
|
||||
<label for="vlan_id">'+tr("VLAN ID")+':</label>\
|
||||
@ -790,6 +790,7 @@ function setupCreateVNetDialog() {
|
||||
break;
|
||||
case "ebtables":
|
||||
$('input#bridge,label[for="bridge"]',$create_vn_dialog).show();
|
||||
$('select#vlan,label[for="vlan"]',$create_vn_dialog).show();
|
||||
break;
|
||||
case "openvswitch":
|
||||
case "vmware":
|
||||
@ -798,6 +799,9 @@ function setupCreateVNetDialog() {
|
||||
$('input#vlan_id,label[for="vlan_id"]',$create_vn_dialog).show();
|
||||
break;
|
||||
};
|
||||
|
||||
if (!mustBeAdmin())
|
||||
$('input#vlan_id,label[for="vlan_id"]',$create_vn_dialog).hide();
|
||||
});
|
||||
|
||||
//Initialize shown options
|
||||
@ -912,8 +916,8 @@ function setupCreateVNetDialog() {
|
||||
};
|
||||
network_json['phydev']=phydev;
|
||||
if (bridge) network_json['bridge']=bridge;
|
||||
network_json['vlan']=vlan;
|
||||
if (vlan_id) {
|
||||
network_json['vlan']=vlan;
|
||||
network_json['vlan_id']=vlan_id;
|
||||
};
|
||||
break;
|
||||
@ -923,6 +927,7 @@ function setupCreateVNetDialog() {
|
||||
return false;
|
||||
};
|
||||
network_json['bridge']=bridge;
|
||||
network_json['vlan']=vlan;
|
||||
break;
|
||||
case "openvswitch":
|
||||
case "vmware":
|
||||
@ -931,8 +936,8 @@ function setupCreateVNetDialog() {
|
||||
return false;
|
||||
};
|
||||
network_json['bridge']=bridge;
|
||||
network_json['vlan']=vlan;
|
||||
if (vlan_id) {
|
||||
network_json['vlan']=vlan;
|
||||
network_json['vlan_id']=vlan_id;
|
||||
};
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user