From cac54e1b99348c13e18e9daea339d02a10fba320 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 12 Nov 2010 17:10:24 -0800 Subject: [PATCH] new UI - resource page - update primary storage total number after adding primary storage from Add Primary Storage shortcut dialog. --- ui/scripts/cloud.core.resource.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 14d0068ab97..4857f0bee1a 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -1115,10 +1115,7 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel $.ajax({ data: createURL("command=createStoragePool" + array1.join("")), dataType: "json", - success: function(json) { - $thisDialog.find("#spinning_wheel").hide(); - $thisDialog.dialog("close"); - + success: function(json) { if(isMiddleMenuShown() == false) { //not on cluster node (still on pod node, so middle menu is hidden) var $clusterNode = $("#cluster_"+clusterId); if($clusterNode.length > 0) @@ -1141,7 +1138,13 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel primarystorageToMidmenu(item, $midmenuItem1); bindClickToMidMenu($midmenuItem1, primarystorageToRightPanel, primarystorageGetMidmenuId); } - + + var primarystorageTotal = parseInt($("#primarystorage_total").text()); + primarystorageTotal++; + $("#primarystorage_total").text(primarystorageTotal.toString()); + + $thisDialog.find("#spinning_wheel").hide(); + $thisDialog.dialog("close"); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() {