bug 7905: VM wizard - populate hypervisor dropdown by listHypervisors API response instead of hardcoding.

This commit is contained in:
Jessica Wang 2011-01-13 17:30:28 -08:00
parent 621f893f12
commit 190a95413e
2 changed files with 16 additions and 0 deletions

View File

@ -854,9 +854,11 @@
<div class="rev_wiztemp_hypervisortext">
Hypervisor:
<select id="hypervisor_select" class="select" style="width: 70px; float: none; height: 15px; font-size: 10px; margin: 0 0 0 5px; display: inline;">
<!--
<option value='XenServer'>XenServer</option>
<option value='VmWare'>VmWare</option>
<option value='KVM'>KVM</option>
-->
</select>
</div>
<div class="rev_wiztemp_ownertext">

View File

@ -150,6 +150,20 @@ function afterLoadInstanceJSP() {
}
}
});
$.ajax({
data: createURL("command=listHypervisors"),
dataType: "json",
success: function(json) {
var items = json.listhypervisorsresponse.hypervisor;
var $hypervisorDropdown = $("#vmiso_in_vmwizard").find("#hypervisor_select");
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>");
}
}
}
});
}
function bindStartVMButton() {