mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add Cluster dialog - get hypervisor type from ListHypervisor API instead of hardcoding.
This commit is contained in:
parent
b98961bcb1
commit
332f917d09
@ -375,9 +375,11 @@ dictionary = {
|
||||
<li>
|
||||
<label for="cluster_hypervisor"><fmt:message key="label.hypervisor"/>:</label>
|
||||
<select class="select" id="cluster_hypervisor">
|
||||
<!--
|
||||
<option value="Xen Server" SELECTED>Xen Server</option>
|
||||
<option value="KVM">KVM</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
-->
|
||||
</select>
|
||||
</li>
|
||||
<li input_group="vmware">
|
||||
|
||||
@ -736,9 +736,11 @@
|
||||
<li>
|
||||
<label for="cluster_hypervisor"><fmt:message key="label.hypervisor"/>:</label>
|
||||
<select class="select" id="cluster_hypervisor">
|
||||
<!--
|
||||
<option value="Xen Server" SELECTED>Xen Server</option>
|
||||
<option value="KVM">KVM</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
-->
|
||||
</select>
|
||||
</li>
|
||||
<li input_group="vmware">
|
||||
|
||||
@ -432,9 +432,11 @@ dictionary = {
|
||||
<li>
|
||||
<label for="cluster_hypervisor"><fmt:message key="label.hypervisor"/>:</label>
|
||||
<select class="select" id="cluster_hypervisor">
|
||||
<!--
|
||||
<option value="Xen Server" SELECTED>Xen Server</option>
|
||||
<option value="KVM">KVM</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
<option value="VmWare">VMware</option>
|
||||
-->
|
||||
</select>
|
||||
</li>
|
||||
<li input_group="vmware">
|
||||
|
||||
@ -30,6 +30,20 @@
|
||||
initDialog("dialog_add_pool");
|
||||
bindEventHandlerToDialogAddPool($("#dialog_add_pool"));
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listHypervisors"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.listhypervisorsresponse.hypervisor;
|
||||
var $hypervisorDropdown = $("#dialog_add_external_cluster").find("#cluster_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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//switch between different tabs
|
||||
var tabArray = [$("#tab_details"), $("#tab_ipallocation")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_ipallocation")];
|
||||
|
||||
@ -619,6 +619,20 @@ function initAddPodShortcut() {
|
||||
function initAddClusterShortcut() {
|
||||
var $dialogAddCluster = $("#dialog_add_external_cluster_in_resource_page");
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listHypervisors"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.listhypervisorsresponse.hypervisor;
|
||||
var $hypervisorDropdown = $dialogAddCluster.find("#cluster_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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var $zoneDropdown = $dialogAddCluster.find("#zone_dropdown");
|
||||
var $podDropdown = $dialogAddCluster.find("#pod_dropdown");
|
||||
|
||||
|
||||
@ -26,6 +26,20 @@
|
||||
initDialog("dialog_add_pod", 370);
|
||||
initDialog("dialog_add_host_in_zone_page");
|
||||
initDialog("dialog_add_pool_in_zone_page");
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listHypervisors"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.listhypervisorsresponse.hypervisor;
|
||||
var $hypervisorDropdown = $("#dialog_add_external_cluster_in_zone_page").find("#cluster_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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//switch between different tabs in zone page
|
||||
var tabArray = [$("#tab_details")];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user