From 0d07743858fbb09c1278956b09383de87330918b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 6 Oct 2010 17:36:31 -0700 Subject: [PATCH] new UI - vm wizard - step 1 - add hypervisor dropdown. listing templates will change based on selected item in hypervisor dropdown. listing ISO won't. --- ui/new/jsp/instance.jsp | 9 +++++++++ ui/new/scripts/cloud.core2.instance.js | 21 ++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ui/new/jsp/instance.jsp b/ui/new/jsp/instance.jsp index 8c07deda1e4..b03810c5e26 100644 --- a/ui/new/jsp/instance.jsp +++ b/ui/new/jsp/instance.jsp @@ -223,6 +223,15 @@ Availability Zone: + + + +
    diff --git a/ui/new/scripts/cloud.core2.instance.js b/ui/new/scripts/cloud.core2.instance.js index ce1410bafb6..f28ed60c664 100644 --- a/ui/new/scripts/cloud.core2.instance.js +++ b/ui/new/scripts/cloud.core2.instance.js @@ -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") {