Added an additional query for shared direct networks in the vm wizard

This commit is contained in:
will 2011-01-07 17:42:37 -08:00
parent 323fc6299d
commit 774ca37fce
1 changed files with 22 additions and 0 deletions

View File

@ -899,6 +899,28 @@ function initVMWizard() {
$directNetworkElement.find("#network_direct_desc").text(networks[i].displaytext);
$networkDirectContainer.append($directNetworkElement.show());
}
// Add any additional shared direct networks
$.ajax({
data: createURL("command=listNetworks&isshared=true&zoneId="+$thisPopup.find("#wizard_zone").val()),
dataType: "json",
async: false,
success: function(json) {
var sharedNetworks = json.listnetworksresponse.network;
if (sharedNetworks != null && sharedNetworks.length > 0) {
for (var i = 0; i < sharedNetworks.length; i++) {
if (sharedNetworks[i].type != 'Direct') {
continue;
}
var $directNetworkElement = $networkDirectTemplate.clone().attr("id", "direct"+sharedNetworks[i].id);
$directNetworkElement.find("#network_direct_checkbox").data("jsonObj", sharedNetworks[i]);
$directNetworkElement.find("#network_direct_name").text(sharedNetworks[i].name);
$directNetworkElement.find("#network_direct_desc").text(sharedNetworks[i].displaytext);
$networkDirectContainer.append($directNetworkElement.show());
}
}
}
});
}
}
});