mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 8655: Add Zone Wizard - Advanced Mode - Security Group - step 4 - create direct VLAN with VLAN ID.
This commit is contained in:
parent
46331ac536
commit
c06444c079
@ -19,6 +19,8 @@ label.security.groups.enabled=Security Groups Enabled
|
|||||||
label.isolation.mode=Isolation Mode
|
label.isolation.mode=Isolation Mode
|
||||||
label.virtual=Virtual
|
label.virtual=Virtual
|
||||||
label.security.group=Security Group
|
label.security.group=Security Group
|
||||||
|
message.advanced.virtual=Advanced Zone - Virtual Network
|
||||||
|
message.advanced.security.group=Advanced Zone - Security Group
|
||||||
|
|
||||||
#Labels
|
#Labels
|
||||||
label.cpu.allocated=CPU Allocated
|
label.cpu.allocated=CPU Allocated
|
||||||
|
|||||||
@ -190,15 +190,15 @@
|
|||||||
<form>
|
<form>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="isolation_mode" value="false" id="isolation_mode_virtual" class="radio" />
|
<input type="radio" name="isolation_mode" value="false" id="advanced_virtual" class="radio" />
|
||||||
<label class="label"><fmt:message key="label.virtual"/></label>
|
<label class="label"><fmt:message key="label.virtual"/></label>
|
||||||
<span>Some description will appear here. Some description will appear here. Some description will appear here..</span>
|
<span><fmt:message key="message.advanced.virtual"/></span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="isolation_mode" value="true" id="isolation_mode_securitygroup" class="radio" />
|
<input type="radio" name="isolation_mode" value="true" id="advanced_securitygroup" class="radio" />
|
||||||
<label class="label"><fmt:message key="label.security.group"/></label>
|
<label class="label"><fmt:message key="label.security.group"/></label>
|
||||||
<span>Some description will appear here. Some description will appear here. Some description will appear here..</span>
|
<span><fmt:message key="message.advanced.security.group"/></span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</form>
|
</form>
|
||||||
@ -429,7 +429,29 @@
|
|||||||
<div class="zonepopup_contentpanel">
|
<div class="zonepopup_contentpanel">
|
||||||
<div class="zonepoup_formcontent">
|
<div class="zonepoup_formcontent">
|
||||||
<form action="#" method="post" id="form_acquire">
|
<form action="#" method="post" id="form_acquire">
|
||||||
<ol id="guestip_list">
|
<ol id="create_direct_vlan">
|
||||||
|
|
||||||
|
<li style="display: none" id="vlan_id_container">
|
||||||
|
<label style="width: 115px;">
|
||||||
|
<fmt:message key="label.vlan.id"/>:</label>
|
||||||
|
<input class="text" type="text" id="vlan_id" />
|
||||||
|
<div id="vlan_id_errormsg" class="dialog_formcontent_errormsg" style="display: none; margin-left:0;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li id="guestgateway_container">
|
||||||
|
<label style="width: 115px;">
|
||||||
|
<fmt:message key="label.guest.gateway"/>:</label>
|
||||||
|
<input class="text" type="text" id="guestgateway" />
|
||||||
|
<div id="guestgateway_errormsg" class="dialog_formcontent_errormsg" style="display: none; margin-left:0;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li id="guestnetmask_container">
|
||||||
|
<label style="width: 115px;">
|
||||||
|
<fmt:message key="label.guest.netmask"/>:</label>
|
||||||
|
<input class="text" type="text" id="guestnetmask" />
|
||||||
|
<div id="guestnetmask_errormsg" class="dialog_formcontent_errormsg" style="display: none; margin-left:0;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li id="guestip_container">
|
<li id="guestip_container">
|
||||||
<label style="width: 115px;">
|
<label style="width: 115px;">
|
||||||
<fmt:message key="label.guest.ip.range"/>:</label>
|
<fmt:message key="label.guest.ip.range"/>:</label>
|
||||||
@ -439,23 +461,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="endguestip_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="endguestip_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
</li>
|
|
||||||
<li id="guestnetmask_container">
|
|
||||||
<label style="width: 115px;">
|
|
||||||
<fmt:message key="label.guest.netmask"/>:</label>
|
|
||||||
<input class="text" type="text" id="guestnetmask" />
|
|
||||||
<div id="guestnetmask_errormsg" class="dialog_formcontent_errormsg" style="display: none; margin-left:0;">
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li id="guestgateway_container">
|
|
||||||
<label style="width: 115px;">
|
|
||||||
<fmt:message key="label.guest.gateway"/>:</label>
|
|
||||||
<input class="text" type="text" id="guestgateway" />
|
|
||||||
<div id="guestgateway_errormsg" class="dialog_formcontent_errormsg" style="display: none; margin-left:0;">
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
<ol id="publicip_list" style="display:none">
|
<ol id="create_virtual_vlan" style="display:none">
|
||||||
<li id="add_publicip_vlan_container">
|
<li id="add_publicip_vlan_container">
|
||||||
<label for="add_publicip_vlan_tagged">
|
<label for="add_publicip_vlan_tagged">
|
||||||
<fmt:message key="label.vlan"/>:</label>
|
<fmt:message key="label.vlan"/>:</label>
|
||||||
|
|||||||
@ -489,7 +489,7 @@ function initAddPodShortcut() {
|
|||||||
isValid &= validateIp("Gateway", $thisDialog.find("#add_pod_gateway"), $thisDialog.find("#add_pod_gateway_errormsg")); //required when creating
|
isValid &= validateIp("Gateway", $thisDialog.find("#add_pod_gateway"), $thisDialog.find("#add_pod_gateway_errormsg")); //required when creating
|
||||||
|
|
||||||
if($thisDialog.find("#guestip_container").css("display") != "none")
|
if($thisDialog.find("#guestip_container").css("display") != "none")
|
||||||
isValid &= addZoneWizardValidateGuestIPRange($thisDialog);
|
isValid &= addZoneWizardValidateDirectVLAN($thisDialog);
|
||||||
|
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
return;
|
return;
|
||||||
@ -1158,13 +1158,14 @@ function initAddZoneWizard() {
|
|||||||
$thisWizard.find("#step2").find("#add_zone_vlan_container, #add_zone_guestcidraddress_container").hide();
|
$thisWizard.find("#step2").find("#add_zone_vlan_container, #add_zone_guestcidraddress_container").hide();
|
||||||
|
|
||||||
//direct VLAN: createVlanIpRange&forVirtualNetwork=false //BasicZone's SecurityGroupsEnabled is true
|
//direct VLAN: createVlanIpRange&forVirtualNetwork=false //BasicZone's SecurityGroupsEnabled is true
|
||||||
$thisWizard.find("#step4").find("#guestip_list").show();
|
$thisWizard.find("#step4").find("#create_direct_vlan").show();
|
||||||
$thisWizard.find("#step4").find("#publicip_list").hide();
|
$thisWizard.find("#step4").find("#create_direct_vlan").find("#vlan_id_container").hide();
|
||||||
|
|
||||||
|
$thisWizard.find("#step4").find("#create_virtual_vlan").hide();
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Advanced": //create VLAN in zone-level
|
case "Advanced": //create VLAN in zone-level
|
||||||
//$thisWizard.find("#step1").find("input[name=isolation_mode]:eq(0)").attr("checked", true); //check the 1st radio button under Insolation Mode
|
|
||||||
$thisWizard.find("#step1").find("input[name=isolation_mode]:eq(0)").click(); //check the 1st radio button under Insolation Mode
|
$thisWizard.find("#step1").find("input[name=isolation_mode]:eq(0)").click(); //check the 1st radio button under Insolation Mode
|
||||||
|
|
||||||
$thisWizard.find("#step2").find("#add_zone_vlan_container, #add_zone_guestcidraddress_container").show();
|
$thisWizard.find("#step2").find("#add_zone_vlan_container, #add_zone_guestcidraddress_container").show();
|
||||||
@ -1172,19 +1173,21 @@ function initAddZoneWizard() {
|
|||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "isolation_mode_virtual":
|
case "advanced_virtual":
|
||||||
//virtual VLAN: createVlanIpRange&forVirtualNetwork=true //Advanced Zone - when securitygroup is NOT enabled
|
//virtual VLAN: createVlanIpRange&forVirtualNetwork=true //Advanced Zone - when securitygroup is NOT enabled
|
||||||
$thisWizard.find("#step4").find("#publicip_list").show();
|
$thisWizard.find("#step4").find("#create_virtual_vlan").show();
|
||||||
$addZoneWizard.find("#step4").find("#publicip_list").find("#add_publicip_vlan_scope").change();
|
$addZoneWizard.find("#step4").find("#create_virtual_vlan").find("#add_publicip_vlan_scope").change();
|
||||||
$thisWizard.find("#step4").find("#guestip_list").hide();
|
$thisWizard.find("#step4").find("#create_direct_vlan").hide();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "isolation_mode_securitygroup":
|
case "advanced_securitygroup":
|
||||||
//direct VLAN: createVlanIpRange&forVirtualNetwork=false //Advanced Zone - when securitygroup is enabled
|
//direct VLAN: createVlanIpRange&forVirtualNetwork=false //Advanced Zone - when securitygroup is enabled
|
||||||
$thisWizard.find("#step4").find("#guestip_list").show();
|
$thisWizard.find("#step4").find("#create_direct_vlan").show();
|
||||||
$thisWizard.find("#step4").find("#publicip_list").hide();
|
$thisWizard.find("#step4").find("#create_direct_vlan").find("#vlan_id_container").show();
|
||||||
|
|
||||||
|
$thisWizard.find("#step4").find("#create_virtual_vlan").hide();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
@ -1267,10 +1270,10 @@ function initAddZoneWizard() {
|
|||||||
|
|
||||||
case "submit": //step 4 => make API call
|
case "submit": //step 4 => make API call
|
||||||
var isValid = true;
|
var isValid = true;
|
||||||
if($thisWizard.find("#step4").find("#guestip_list").css("display") != "none")
|
if($thisWizard.find("#step4").find("#create_direct_vlan").css("display") != "none")
|
||||||
isValid = addZoneWizardValidateGuestIPRange($thisWizard);
|
isValid = addZoneWizardValidateDirectVLAN($thisWizard);
|
||||||
if($thisWizard.find("#step4").find("#publicip_list").css("display") != "none")
|
if($thisWizard.find("#step4").find("#create_virtual_vlan").css("display") != "none")
|
||||||
isValid &= addZoneWizardValidatePublicIPRange($thisWizard);
|
isValid &= addZoneWizardValidateVirtualVLAN($thisWizard);
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1312,16 +1315,20 @@ function addZoneWizardValidatePod($thisWizard) {
|
|||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addZoneWizardValidateGuestIPRange($thisWizard) {
|
function addZoneWizardValidateDirectVLAN($thisWizard) {
|
||||||
var isValid = true;
|
var isValid = true;
|
||||||
isValid &= validateIp("Guest IP Range", $thisWizard.find("#startguestip"), $thisWizard.find("#startguestip_errormsg")); //required
|
|
||||||
isValid &= validateIp("Guest IP Range", $thisWizard.find("#endguestip"), $thisWizard.find("#endguestip_errormsg"), true); //optional
|
var $createDirectVLAN = $thisWizard.find("#step4").find("#create_direct_vlan");
|
||||||
isValid &= validateIp("Guest Netmask", $thisWizard.find("#guestnetmask"), $thisWizard.find("#guestnetmask_errormsg")); //required when creating
|
if($createDirectVLAN.find("#vlan_id_container").css("display") != "none")
|
||||||
isValid &= validateIp("Guest Gateway", $thisWizard.find("#guestgateway"), $thisWizard.find("#guestgateway_errormsg"));
|
isValid &= validateNumber("VLAN ID", $createDirectVLAN.find("#vlan_id"), $createDirectVLAN.find("#vlan_id_errormsg")); //required
|
||||||
|
isValid &= validateIp("Guest IP Range", $createDirectVLAN.find("#startguestip"), $createDirectVLAN.find("#startguestip_errormsg")); //required
|
||||||
|
isValid &= validateIp("Guest IP Range", $createDirectVLAN.find("#endguestip"), $createDirectVLAN.find("#endguestip_errormsg"), true); //optional
|
||||||
|
isValid &= validateIp("Guest Netmask", $createDirectVLAN.find("#guestnetmask"), $createDirectVLAN.find("#guestnetmask_errormsg")); //required when creating
|
||||||
|
isValid &= validateIp("Guest Gateway", $createDirectVLAN.find("#guestgateway"), $createDirectVLAN.find("#guestgateway_errormsg"));
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addZoneWizardValidatePublicIPRange($thisWizard) {
|
function addZoneWizardValidateVirtualVLAN($thisWizard) {
|
||||||
var isValid = true;
|
var isValid = true;
|
||||||
var isTagged = $thisWizard.find("#step4").find("#add_publicip_vlan_tagged").val() == "tagged";
|
var isTagged = $thisWizard.find("#step4").find("#add_publicip_vlan_tagged").val() == "tagged";
|
||||||
|
|
||||||
@ -1468,18 +1475,25 @@ function addZoneWizardSubmit($thisWizard) {
|
|||||||
});
|
});
|
||||||
// create pod (end)
|
// create pod (end)
|
||||||
|
|
||||||
// add guest IP range to basic zone (begin)
|
// create direct VLAN (basic zone, advanced zone + security group)
|
||||||
if($thisWizard.find("#step4").find("#guestip_list").css("display") != "none") {
|
if($thisWizard.find("#step4").find("#create_direct_vlan").css("display") != "none") {
|
||||||
var netmask = $thisWizard.find("#step4").find("#guestip_list").find("#guestnetmask").val();
|
var netmask = $thisWizard.find("#step4").find("#create_direct_vlan").find("#guestnetmask").val();
|
||||||
var startip = $thisWizard.find("#step4").find("#guestip_list").find("#startguestip").val();
|
var startip = $thisWizard.find("#step4").find("#create_direct_vlan").find("#startguestip").val();
|
||||||
var endip = $thisWizard.find("#step4").find("#guestip_list").find("#endguestip").val();
|
var endip = $thisWizard.find("#step4").find("#create_direct_vlan").find("#endguestip").val();
|
||||||
var guestgateway = $thisWizard.find("#step4").find("#guestip_list").find("#guestgateway").val();
|
var guestgateway = $thisWizard.find("#step4").find("#create_direct_vlan").find("#guestgateway").val();
|
||||||
|
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
array1.push("&vlan=untagged");
|
|
||||||
array1.push("&zoneid=" + zoneId);
|
|
||||||
array1.push("&podId=" + podId);
|
|
||||||
array1.push("&forVirtualNetwork=false"); //direct VLAN
|
array1.push("&forVirtualNetwork=false"); //direct VLAN
|
||||||
|
array1.push("&zoneid=" + zoneId);
|
||||||
|
|
||||||
|
if($thisWizard.find("#step4").find("#create_direct_vlan").find("#vlan_id_container").css("display") != "none") {
|
||||||
|
array1.push("&vlan="+$thisWizard.find("#step4").find("#create_direct_vlan").find("#vlan_id").val());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
array1.push("&vlan=untagged");
|
||||||
|
array1.push("&podId=" + podId);
|
||||||
|
}
|
||||||
|
|
||||||
array1.push("&gateway="+todb(guestgateway));
|
array1.push("&gateway="+todb(guestgateway));
|
||||||
array1.push("&netmask="+todb(netmask));
|
array1.push("&netmask="+todb(netmask));
|
||||||
array1.push("&startip="+todb(startip));
|
array1.push("&startip="+todb(startip));
|
||||||
@ -1505,10 +1519,10 @@ function addZoneWizardSubmit($thisWizard) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// add guest IP range to basic zone (end)
|
|
||||||
|
|
||||||
// add public IP range to basic zone (begin)
|
|
||||||
if($thisWizard.find("#step4").find("#publicip_list").css("display") != "none") {
|
// create virtual VLAN (advanced zone + virtual)
|
||||||
|
if($thisWizard.find("#step4").find("#create_virtual_vlan").css("display") != "none") {
|
||||||
var isTagged = $thisWizard.find("#step4").find("#add_publicip_vlan_tagged").val() == "tagged";
|
var isTagged = $thisWizard.find("#step4").find("#add_publicip_vlan_tagged").val() == "tagged";
|
||||||
|
|
||||||
var vlan = trim($thisWizard.find("#step4").find("#add_publicip_vlan_vlan").val());
|
var vlan = trim($thisWizard.find("#step4").find("#add_publicip_vlan_vlan").val());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user