diff --git a/ui/jsp/tab_templates.jsp b/ui/jsp/tab_templates.jsp
index baaabcd4955..e861adc1182 100755
--- a/ui/jsp/tab_templates.jsp
+++ b/ui/jsp/tab_templates.jsp
@@ -259,10 +259,10 @@ long milliseconds = new Date().getTime();
-
diff --git a/ui/new/jsp/template.jsp b/ui/new/jsp/template.jsp
index b3d2fccd100..00891a064e3 100644
--- a/ui/new/jsp/template.jsp
+++ b/ui/new/jsp/template.jsp
@@ -282,28 +282,20 @@
-
+
+
+
+
+
+
+
+
+
-
diff --git a/ui/new/scripts/cloud.core2.template.js b/ui/new/scripts/cloud.core2.template.js
index 61a8a74c291..857ffb499cf 100644
--- a/ui/new/scripts/cloud.core2.template.js
+++ b/ui/new/scripts/cloud.core2.template.js
@@ -5,11 +5,28 @@ function afterLoadTemplateJSP() {
var $detailsTab = $("#right_panel_content #tab_content_details");
//add button ***
+ /*
var formatSelect = $("#dialog_add_template #add_template_format").empty();
if (getHypervisorType() == "kvm")
formatSelect.append("");
else if (getHypervisorType() == "xenserver")
- formatSelect.append("");
+ formatSelect.append("");
+ */
+ $("#dialog_add_template #add_template_hypervisor").bind("change", function(event) {
+ var formatSelect = $("#dialog_add_template #add_template_format").empty();
+ var selectedHypervisorType = $(this).val();
+
+ if(selectedHypervisorType == "XenServer")
+ formatSelect.append("");
+ else if(selectedHypervisorType == "VmWare")
+ formatSelect.append("");
+ else if(selectedHypervisorType == "KVM")
+ formatSelect.append("");
+
+ return false;
+ });
+ $("#dialog_add_template #add_template_hypervisor").change();
+
if(isAdmin())
$("#dialog_add_template #add_template_featured_container, #dialog_edit_template #edit_template_featured_container").show();
@@ -41,6 +58,7 @@ function afterLoadTemplateJSP() {
var password = thisDialog.find("#add_template_password").val();
var isPublic = thisDialog.find("#add_template_public").val();
var osType = thisDialog.find("#add_template_os_type").val();
+ var hypervisor = thisDialog.find("#add_template_hypervisor").val();
var moreCriteria = [];
if(thisDialog.find("#add_template_featured_container").css("display")!="none") {
@@ -51,7 +69,7 @@ function afterLoadTemplateJSP() {
var $midmenuItem1 = beforeAddingMidMenuItem() ;
$.ajax({
- data: createURL("command=registerTemplate&name="+todb(name)+"&displayText="+todb(desc)+"&url="+encodeURIComponent(url)+"&zoneid="+zoneId+"&ispublic="+isPublic+moreCriteria.join("")+"&format="+format+"&passwordEnabled="+password+"&osTypeId="+osType+"&response=json"),
+ data: createURL("command=registerTemplate&name="+todb(name)+"&displayText="+todb(desc)+"&url="+encodeURIComponent(url)+"&zoneid="+zoneId+"&ispublic="+isPublic+moreCriteria.join("")+"&format="+format+"&passwordEnabled="+password+"&osTypeId="+osType+"&hypervisor="+hypervisor+"&response=json"),
dataType: "json",
success: function(json) {
var items = json.registertemplateresponse.template;