From 542b5b2d11e4b2b98b6fa12e4f6f6da2aff208b8 Mon Sep 17 00:00:00 2001 From: will Date: Wed, 27 Oct 2010 18:00:50 -0700 Subject: [PATCH 1/5] New UI - Fixed issues where clicking on a left nav that is opened will make calls to API again. There is no need to do that. --- ui/new/scripts/cloud.core2.init.js | 63 +++++++++++++++--------------- ui/new/scripts/cloud.core2.js | 2 + 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/ui/new/scripts/cloud.core2.init.js b/ui/new/scripts/cloud.core2.init.js index 809539896e0..6590a94c20b 100644 --- a/ui/new/scripts/cloud.core2.init.js +++ b/ui/new/scripts/cloud.core2.init.js @@ -30,11 +30,12 @@ $(document).ready(function() { // Setup first level navigation $("#leftmenu_dashboard").bind("click", function(event) { - selectLeftMenu($(this)); - hideMiddleMenu(); - $("#right_panel").load("jsp/dashboard.jsp", function(){ - afterLoadDashboardJSP(); - }); + if (selectLeftMenu($(this))) { + hideMiddleMenu(); + $("#right_panel").load("jsp/dashboard.jsp", function(){ + afterLoadDashboardJSP(); + }); + } return false; }); $("#leftmenu_storage").bind("click", function(event) { @@ -50,8 +51,9 @@ $(document).ready(function() { return false; }); $("#leftmenu_account").bind("click", function(event) { - selectLeftMenu($(this)); - listMidMenuItems("listAccounts", "listaccountsresponse", "account", "jsp/account.jsp", afterLoadAccountJSP, accountToMidmenu, accountToRightPanel, getMidmenuId, false); + if (selectLeftMenu($(this))) { + listMidMenuItems("listAccounts", "listaccountsresponse", "account", "jsp/account.jsp", afterLoadAccountJSP, accountToMidmenu, accountToRightPanel, getMidmenuId, false); + } return false; }); $("#leftmenu_events").bind("click", function(event) { @@ -59,9 +61,28 @@ $(document).ready(function() { return false; }); $("#leftmenu_system").bind("click", function(event) { - selectLeftMenu($(this), true); - if($("#leftmenu_resource").find("#resource_arrow").hasClass("expanded_open") == true) - $("#leftmenu_resource").click(); //if resource menu is open (i.e. zonetree is shown), empty zonetree and close resource menu. + if (selectLeftMenu($(this), true)) { + if($("#leftmenu_resource").find("#resource_arrow").hasClass("expanded_open") == true) + $("#leftmenu_resource").click(); //if resource menu is open (i.e. zonetree is shown), empty zonetree and close resource menu. + } + return false; + }); + + $("#leftmenu_instances").bind("click", function(event) { + instanceBuildSubMenu(); + selectLeftMenu($(this), true); + return false; + }); + + $("#leftmenu_domain").bind("click", function(event) { + if (selectLeftMenu($(this), true)) { + hideMiddleMenu(); + disableMultipleSelectionInMidMenu(); + clearMiddleMenu(); + + bindEventHandlerToDomainTreeNode(); + refreshWholeTree(g_domainid, defaultRootLevel); + } return false; }); @@ -94,24 +115,6 @@ $(document).ready(function() { bindAndListMidMenuItems($("#leftmenu_disk_offering"), "listDiskOfferings", "listdiskofferingsresponse", "diskoffering", "jsp/diskoffering.jsp", afterLoadDiskOfferingJSP, diskOfferingToMidmenu, diskOfferingToRightPanel, getMidmenuId, false); bindAndListMidMenuItems($("#leftmenu_global_setting"), "listConfigurations", "listconfigurationsresponse", "configuration", "jsp/globalsetting.jsp", afterLoadGlobalSettingJSP, globalSettingToMidmenu, globalSettingToRightPanel, globalSettingGetMidmenuId, false); - $("#leftmenu_instances").bind("click", function(event) { - instanceBuildSubMenu(); - selectLeftMenu($(this), true); - return false; - }); - - $("#leftmenu_domain").bind("click", function(event) { - selectLeftMenu($(this), true); - hideMiddleMenu(); - disableMultipleSelectionInMidMenu(); - clearMiddleMenu(); - - bindEventHandlerToDomainTreeNode(); - refreshWholeTree(g_domainid, defaultRootLevel); - - return false; - }); - $("#leftmenu_resource").bind("click", function(event) { showMiddleMenu(); disableMultipleSelectionInMidMenu(); @@ -140,10 +143,6 @@ $(document).ready(function() { return false; }); - - - - // Prevent the UI from being iframed if the iframe isn't from the same domain. try { if ( top != self && self.location.hostname != top.location.hostname) { diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js index 13062744207..08b52df65da 100644 --- a/ui/new/scripts/cloud.core2.js +++ b/ui/new/scripts/cloud.core2.js @@ -606,7 +606,9 @@ function selectLeftMenu($menuToSelect, expandable) { // Close the help link if it's opened $("#help_dropdown_dialog").hide(); $("#help_button").removeClass("selected"); + return true; } + return false; } var $selectedSubMenu; From 94f98f804297264ecae1de9f505a4a6dcb7e3558 Mon Sep 17 00:00:00 2001 From: will Date: Wed, 27 Oct 2010 18:42:38 -0700 Subject: [PATCH 2/5] New UI - The session timeout dialog will really send you to the login screen now. --- ui/new/scripts/cloud.core2.init.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/new/scripts/cloud.core2.init.js b/ui/new/scripts/cloud.core2.init.js index 6590a94c20b..bd3418e2936 100644 --- a/ui/new/scripts/cloud.core2.init.js +++ b/ui/new/scripts/cloud.core2.init.js @@ -382,7 +382,12 @@ $(document).ready(function() { $("#dialog_error").siblings(".ui-widget-header").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939"); $("#dialog_error").siblings(".ui-dialog-buttonpane").find(".ui-state-default").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939"); - initDialogWithOK("dialog_session_expired"); + $("#dialog_session_expired").dialog({ + autoOpen: false, + modal: true, + zIndex: 2000, + buttons: { "OK": function() { logout(true); $(this).dialog("close"); } } + }); $("#dialog_session_expired").siblings(".ui-widget-header").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939"); $("#dialog_session_expired").siblings(".ui-dialog-buttonpane").find(".ui-state-default").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939"); From 1d2d917c323f021a7547a44aa1855643ad670b1c Mon Sep 17 00:00:00 2001 From: NIKITA Date: Wed, 27 Oct 2010 19:00:00 -0700 Subject: [PATCH 3/5] Action bar added for resources --- ui/new/jsp/resource.jsp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/ui/new/jsp/resource.jsp b/ui/new/jsp/resource.jsp index 7c767aa3524..4d114b6fe6a 100644 --- a/ui/new/jsp/resource.jsp +++ b/ui/new/jsp/resource.jsp @@ -637,16 +637,35 @@ <%=t.t("details")%> -
- From 13626f556a9c239922a2c93ae5d331374ee22bfc Mon Sep 17 00:00:00 2001 From: NIKITA Date: Wed, 27 Oct 2010 19:26:02 -0700 Subject: [PATCH 4/5] Midmenu box has restricted height now --- ui/new/css/main.css | 8 +++++--- ui/new/index.jsp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/new/css/main.css b/ui/new/css/main.css index 8967697836f..93de1d09cfe 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -2167,7 +2167,7 @@ a:hover.search_button { .midmenu_content{ width:220px; - height:auto; + height:35px; float:left; color:#333; text-align:left; @@ -2224,24 +2224,26 @@ a:hover.search_button { .midmenu_textbox p { width:165px; - height:auto; + height:13px; float:left; text-align:left; font-weight:normal; font-size:11px; margin:3px 0 0 0; padding:0; + overflow:hidden; } .midmenu_textbox span { width:165px; - height:auto; + height:13px; float:left; text-align:left; font-weight:normal; font-size:10px; margin:3px 0 0 0; padding:0; + overflow:hidden; } .midmenu_emptymsgbox { diff --git a/ui/new/index.jsp b/ui/new/index.jsp index d06bb93580b..9e83513106f 100644 --- a/ui/new/index.jsp +++ b/ui/new/index.jsp @@ -737,10 +737,10 @@ long milliseconds = new Date().getTime();
-

+

 

- +  
From 1736f081e46d988f5b8c813cec55b8110a4bcc5f Mon Sep 17 00:00:00 2001 From: will Date: Wed, 27 Oct 2010 19:41:23 -0700 Subject: [PATCH 5/5] The real commit for the dashboard fix --- ui/new/scripts/cloud.core2.init.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/new/scripts/cloud.core2.init.js b/ui/new/scripts/cloud.core2.init.js index bd3418e2936..a77c6649122 100644 --- a/ui/new/scripts/cloud.core2.init.js +++ b/ui/new/scripts/cloud.core2.init.js @@ -31,6 +31,7 @@ $(document).ready(function() { // Setup first level navigation $("#leftmenu_dashboard").bind("click", function(event) { if (selectLeftMenu($(this))) { + clearMiddleMenu(); hideMiddleMenu(); $("#right_panel").load("jsp/dashboard.jsp", function(){ afterLoadDashboardJSP();