mirror of https://github.com/apache/cloudstack.git
- Enable virtual networking mode in the VM wizard.
This commit is contained in:
parent
344160aada
commit
54ece4c460
|
|
@ -622,24 +622,20 @@
|
|||
<h3>
|
||||
</h3>
|
||||
<div class="vmpopup_offeringpanel" style="position:relative;">
|
||||
<div id="underconstruction">
|
||||
<div class="vmpopup_offeringpanel_overlay"></div>
|
||||
<div class="vmpopup_offeringpanel_underconstructionbox"><p> Under Construction </p></div>
|
||||
</div>
|
||||
<div class="vmpopup_offeringbox">
|
||||
<input type="radio" name="radiogroup" class="radio" selected />
|
||||
<label class="label">
|
||||
My Virtual Network</label>
|
||||
<div class="vmpopup_offeringbox" id="network_virtual_container">
|
||||
<input type="radio" id="network_virtual" name="radiogroup" class="radio" checked" />
|
||||
<label class="label" id="network_virtual_name">Virtual Network</label>
|
||||
<div class="vmpopup_offdescriptionbox">
|
||||
<div class="vmpopup_offdescriptionbox_top">
|
||||
</div>
|
||||
<div class="vmpopup_offdescriptionbox_bot">
|
||||
<p>
|
||||
A virtual private network that is fronted by a virtual router.
|
||||
<p id="network_virtual_desc">
|
||||
A dedicated virtualized network for your account. The broadcast domain is contrained within a VLAN and all public network access is routed out by a virtual router.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="vmpopup_offeringbox">
|
||||
<input type="radio" name="radiogroup" class="radio" selected />
|
||||
<label class="label">
|
||||
|
|
@ -689,6 +685,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="vmpopup_navigationpanel">
|
||||
|
|
|
|||
|
|
@ -479,9 +479,51 @@ function initVMWizard() {
|
|||
//Safari and Chrome are not smart enough to make checkbox checked if html markup is appended by JQuery.append(). So, the following 2 lines are added.
|
||||
var html_all = $rootDiskOfferingContainer.html();
|
||||
$rootDiskOfferingContainer.html(html_all);
|
||||
//***** root disk offering: "custom", existing disk offerings in database (end) *********************************************************************
|
||||
//***** root disk offering: "custom", existing disk offerings in database (end) *********************************************************************
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Setup networks
|
||||
$.ajax({
|
||||
data: createURL("command=listNetworks"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var networks = json.listnetworksresponse.network;
|
||||
var virtualNetwork = null;
|
||||
if (networks != null && networks.length > 0) {
|
||||
for (var i = 0; i < networks.length; i++) {
|
||||
if (networks[i].type == 'Virtualized') {
|
||||
virtualNetwork = network[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
var $virtualNetworkElement = $("#vm_popup #network_virtual_container");
|
||||
|
||||
if (virtualNetwork == null) {
|
||||
$virtualNetworkElement.data("isNetwork", false);
|
||||
$.ajax({
|
||||
data: createURL("command=listNetworkOfferings"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var networkOfferings = json.listnetworkofferingsresponse.networkoffering;
|
||||
if (networkOfferings != null && networkOfferings.length > 0) {
|
||||
for (var i = 0; i < networkOfferings.length; i++) {
|
||||
if (networkOfferings[i].type == "Virtualized" && networkOfferings[i].isdefault) {
|
||||
$virtualNetworkElement.data("id", networkOfferings[i].id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$virtualNetworkElement.data("isNetwork", true).data("id", virtualNetwork.id);
|
||||
//$virtualNetworkElement.find("#network_virtual_name").text(virtualNetwork.name);
|
||||
//$virtualNetworkElement.find("#network_virtual_desc").text(virtualNetwork.displaytext);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$vmPopup.find("#wizard_service_offering").click();
|
||||
return false;
|
||||
|
|
@ -832,8 +874,27 @@ function initVMWizard() {
|
|||
$thisPopup.find("#wizard_review_disk_offering").text(diskOfferingName);
|
||||
}
|
||||
|
||||
if (currentStepInVmPopup == 4) { //network
|
||||
|
||||
if (currentStepInVmPopup == 4) { //network
|
||||
var $virtualNetworkElement = $("#vm_popup #network_virtual_container");
|
||||
var isVirtualNetwork = $virtualNetworkElement.data("isNetwork");
|
||||
|
||||
if (!isVirtualNetwork) {
|
||||
// hardcoded text for now
|
||||
var networkName = "Virtual Network";
|
||||
var networkDesc = "A dedicated virtualized network for your account. The broadcast domain is contrained within a VLAN and all public network access is routed out by a virtual router.";
|
||||
var id = $virtualNetworkElement.data("id");
|
||||
// Create a network from this.
|
||||
$.ajax({
|
||||
data: createURL("command=createNetwork&networkOfferingId="+id+"&name="+todb(networkName)+"&displayText="+todb(networkDesc)+"&zoneId="+$thisPopup.find("#wizard_zone").val()),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var network = json.createnetworkresponse.network;
|
||||
$virtualNetworkElement.data("id", network.id);
|
||||
$thisPopup.find("#wizard_review_network").text(networkName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (currentStepInVmPopup == 5) { //last step
|
||||
|
|
@ -850,7 +911,8 @@ function initVMWizard() {
|
|||
moreCriteria.push("&zoneId="+$thisPopup.find("#wizard_zone").val());
|
||||
moreCriteria.push("&hypervisor="+$selectedVmWizardTemplate.data("hypervisor"));
|
||||
moreCriteria.push("&templateId="+$selectedVmWizardTemplate.data("templateId"));
|
||||
moreCriteria.push("&serviceOfferingId="+$thisPopup.find("input:radio[name=service_offering_radio]:checked").val());
|
||||
moreCriteria.push("&serviceOfferingId="+$thisPopup.find("input:radio[name=service_offering_radio]:checked").val());
|
||||
moreCriteria.push("$network="+$thisPopup.find("#network_virtual_container").data("id"));
|
||||
|
||||
var diskOfferingId, $diskOfferingElement;
|
||||
if ($thisPopup.find("#wiz_blank").hasClass("rev_wizmid_selectedtempbut")) { //ISO
|
||||
|
|
|
|||
Loading…
Reference in New Issue