mirror of https://github.com/apache/cloudstack.git
bug 7905: template page - add template dialog - populate hypervisor dropdown by listHypervisors API response instead of hardcoding.
This commit is contained in:
parent
7c2fffe67a
commit
a9dd415995
|
|
@ -348,10 +348,12 @@
|
|||
</li>
|
||||
<li>
|
||||
<label for="add_template_hypervisor">Hypervisor:</label>
|
||||
<select class="select" name="add_template_hypervisor" id="add_template_hypervisor">
|
||||
<select class="select" name="add_template_hypervisor" id="add_template_hypervisor">
|
||||
<!--
|
||||
<option value='XenServer'>Citrix XenServer</option>
|
||||
<option value='VmWare'>VMware ESX</option>
|
||||
<option value='KVM'>KVM</option>
|
||||
-->
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -54,8 +54,21 @@ function templateGetSearchParams() {
|
|||
|
||||
function afterLoadTemplateJSP() {
|
||||
var $detailsTab = $("#right_panel_content #tab_content_details");
|
||||
|
||||
//add button ***
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listHypervisors"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.listhypervisorsresponse.hypervisor;
|
||||
var $hypervisorDropdown = $("#dialog_add_template").find("#add_template_hypervisor");
|
||||
if(items != null && items.length > 0) {
|
||||
for(var i=0; i<items.length; i++) {
|
||||
$hypervisorDropdown.append("<option value='"+fromdb(items[i].name)+"'>"+fromdb(items[i].name)+"</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$("#dialog_add_template #add_template_hypervisor").bind("change", function(event) {
|
||||
var formatSelect = $("#dialog_add_template #add_template_format").empty();
|
||||
var selectedHypervisorType = $(this).val();
|
||||
|
|
|
|||
Loading…
Reference in New Issue