From 831656971097af37eb600262aa5c6a4757e4b564 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 6 May 2011 19:21:30 -0700 Subject: [PATCH] bug 9774: snapshot page - (1) add state grid row in details tab. (2) only show action "Create Volume", "Create Template" when snapshot state is "BackedUp". --- ui/jsp/snapshot.jsp | 16 +++++++++++++--- ui/scripts/cloud.core.snapshot.js | 10 +++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ui/jsp/snapshot.jsp b/ui/jsp/snapshot.jsp index f96d7adb1d0..e5858e26efa 100644 --- a/ui/jsp/snapshot.jsp +++ b/ui/jsp/snapshot.jsp @@ -93,6 +93,16 @@ dictionary = {
+
+
+ :
+
+
+
+
+
+
+
:
@@ -102,7 +112,7 @@ dictionary = {
-
+
:
@@ -112,7 +122,7 @@ dictionary = {
-
+
:
@@ -122,7 +132,7 @@ dictionary = {
-
+
:
diff --git a/ui/scripts/cloud.core.snapshot.js b/ui/scripts/cloud.core.snapshot.js index c01ef8d0c8d..7ab5e17dc99 100644 --- a/ui/scripts/cloud.core.snapshot.js +++ b/ui/scripts/cloud.core.snapshot.js @@ -168,7 +168,8 @@ function snapshotJsonToDetailsTab() { }); $thisTab.find("#id").text(fromdb(jsonObj.id)); - $thisTab.find("#name").text(fromdb(jsonObj.name)); + $thisTab.find("#name").text(fromdb(jsonObj.name)); + $thisTab.find("#state").text(fromdb(jsonObj.state)); $thisTab.find("#volume_name").text(fromdb(jsonObj.volumename)); $thisTab.find("#interval_type").text(fromdb(jsonObj.intervaltype)); $thisTab.find("#account").text(fromdb(jsonObj.account)); @@ -178,9 +179,12 @@ function snapshotJsonToDetailsTab() { //actions *** var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu"); $actionMenu.find("#action_list").empty(); - buildActionLinkForTab("label.action.create.volume" , snapshotActionMap, $actionMenu, $midmenuItem1, $thisTab); + + if(jsonObj.state == "BackedUp") { + buildActionLinkForTab("label.action.create.volume" , snapshotActionMap, $actionMenu, $midmenuItem1, $thisTab); + buildActionLinkForTab("label.action.create.template", snapshotActionMap, $actionMenu, $midmenuItem1, $thisTab); + } buildActionLinkForTab("label.action.delete.snapshot", snapshotActionMap, $actionMenu, $midmenuItem1, $thisTab); - buildActionLinkForTab("label.action.create.template", snapshotActionMap, $actionMenu, $midmenuItem1, $thisTab); $thisTab.find("#tab_spinning_wheel").hide(); $thisTab.find("#tab_container").show();