mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
new UI - cluster page - show host header and primary storage header in middle menu even there is no host or no primary storage.
This commit is contained in:
parent
19ee44b1c8
commit
4b8b149237
@ -23,24 +23,23 @@ function afterLoadClusterJSP($midmenuItem1) {
|
||||
$("#midmenu_add2_link").unbind("click").hide();
|
||||
$("#midmenu_add3_link").unbind("click").hide();
|
||||
|
||||
clusterJsonToRightPanel($midmenuItem1);
|
||||
|
||||
var clusterId = $midmenuItem1.data("jsonObj").id;
|
||||
|
||||
var $midmenuContainer = $("#midmenu_container").empty();
|
||||
var $header1 = $("#midmenu_itemheader_without_margin").clone(); //without margin on top
|
||||
clusterJsonToRightPanel($midmenuItem1);
|
||||
var clusterId = $midmenuItem1.data("jsonObj").id;
|
||||
var $midmenuContainer = $("#midmenu_container").empty();
|
||||
|
||||
var $container_host = $("<div id='midmenu_host_container'></div>");
|
||||
$midmenuContainer.append($container_host);
|
||||
var $header1 = $("#midmenu_itemheader_without_margin").clone().show(); //without margin on top
|
||||
$header1.find("#name").text("Host");
|
||||
$midmenuContainer.append($header1);
|
||||
var count1 = listMidMenuItems2(("listHosts&type=Routing&clusterid="+clusterId), "listhostsresponse", "host", hostToMidmenu, hostToRightPanel, hostGetMidmenuId, false, true);
|
||||
if(count1 > 0)
|
||||
$header1.show();
|
||||
|
||||
var $header2 = $("#midmenu_itemheader_with_margin").clone(); //with margin on top
|
||||
$container_host.append($header1);
|
||||
listMidMenuItems2(("listHosts&type=Routing&clusterid="+clusterId), "listhostsresponse", "host", hostToMidmenu, hostToRightPanel, hostGetMidmenuId, false, true, $container_host);
|
||||
|
||||
var $container_primarystorage = $("<div id='midmenu_primarystorage_container'></div>");
|
||||
$midmenuContainer.append($container_primarystorage);
|
||||
var $header2 = $("#midmenu_itemheader_with_margin").clone().show(); //with margin on top
|
||||
$header2.find("#name").text("Primary Storage");
|
||||
$midmenuContainer.append($header2);
|
||||
var count2 = listMidMenuItems2(("listStoragePools&clusterid="+clusterId), "liststoragepoolsresponse", "storagepool", primarystorageToMidmenu, primarystorageToRightPanel, primarystorageGetMidmenuId, false, false);
|
||||
if(count2 > 0)
|
||||
$header2.show();
|
||||
$container_primarystorage.append($header2);
|
||||
listMidMenuItems2(("listStoragePools&clusterid="+clusterId), "liststoragepoolsresponse", "storagepool", primarystorageToMidmenu, primarystorageToRightPanel, primarystorageGetMidmenuId, false, false, $container_primarystorage);
|
||||
}
|
||||
|
||||
function clusterJsonToRightPanel($leftmenuItem1) {
|
||||
|
||||
@ -904,7 +904,7 @@ function getMidmenuId(jsonObj) {
|
||||
return "midmenuItem_" + jsonObj.id;
|
||||
}
|
||||
|
||||
function listMidMenuItems2(commandString, jsonResponse1, jsonResponse2, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu, clickFirstItem) {
|
||||
function listMidMenuItems2(commandString, jsonResponse1, jsonResponse2, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu, clickFirstItem, $midMenuContainer) {
|
||||
if(isMultipleSelectionInMidMenu == true)
|
||||
enableMultipleSelectionInMidMenu();
|
||||
else
|
||||
@ -925,7 +925,11 @@ function listMidMenuItems2(commandString, jsonResponse1, jsonResponse2, toMidmen
|
||||
$midmenuItem1.data("toRightPanelFn", toRightPanelFn);
|
||||
toMidmenuFn(items[i], $midmenuItem1);
|
||||
bindClickToMidMenu($midmenuItem1, toRightPanelFn, getMidmenuIdFn);
|
||||
$("#midmenu_container").append($midmenuItem1.show());
|
||||
|
||||
if($midMenuContainer == null)
|
||||
$midMenuContainer = $("#midmenu_container");
|
||||
|
||||
$midMenuContainer.append($midmenuItem1.show());
|
||||
if(clickFirstItem == true && i == 0) { //click the 1st item in middle menu as default
|
||||
$midmenuItem1.click();
|
||||
if(isMultipleSelectionInMidMenu == true) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user