new UI - vm wizard - step 1 - add hypervisor dropdown. listing templates will change based on selected item in hypervisor dropdown. listing ISO won't.

This commit is contained in:
Jessica Wang 2010-10-06 17:36:31 -07:00
parent 9d1270b35f
commit 0d07743858
2 changed files with 23 additions and 7 deletions

View File

@ -223,6 +223,15 @@
Availability Zone:</label>
<select class="select" id="wizard_zone" name="zone">
</select>
<label>
Hypervisor:</label>
<select id="wizard_hypervisor">
<option value='XenServer'>Citrix XenServer</option>
<option value='VmWare'>VMware ESX</option>
<option value='KVM'>KVM</option>
</select>
<div class="rev_tempsearchbox">
<form method="post" action="#">
<ol>

View File

@ -314,19 +314,20 @@ function clickInstanceGroupHeader($arrowIcon) {
var commandString;
var searchInput = $vmPopup.find("#search_input").val();
if (selectedTemplateTypeInVmPopup != "blank") {
if (selectedTemplateTypeInVmPopup != "blank") { //template
var hypervisor = $vmPopup.find("#wizard_hypervisor").val();
if (searchInput != null && searchInput.length > 0)
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup;
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup;
else
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup;
} else {
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&page="+currentPageInTemplateGridInVmPopup;
}
else { //ISO
if (searchInput != null && searchInput.length > 0)
commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup;
else
commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup;
}
commandString += "&hypervisor=XenServer"; //This line is temporary. will change it later.
var loading = $vmPopup.find("#wiz_template_loading").show();
if(currentPageInTemplateGridInVmPopup==1)
$vmPopup.find("#prevPage").hide();
@ -406,7 +407,13 @@ function clickInstanceGroupHeader($arrowIcon) {
listTemplatesInVmPopup();
return false;
});
$vmPopup.find("#wizard_hypervisor").bind("change", function(event) {
var selectedHypervisor = $(this).val();
if(selectedHypervisor != null && selectedHypervisor.length > 0)
listTemplatesInVmPopup();
return false;
});
function displayDiskOffering(type) {
if(type=="data") {