From 45fcbd74d578efd3536d727384bdc58ad0330e17 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 16 Jun 2011 16:42:32 -0700 Subject: [PATCH] bug 10335: cloudStack UI - volume page - snapshot tab - hide Create Volume, Create Template action when snapshot state is not Backedup. --- ui/jsp/volume.jsp | 18 ++++++++++++++---- ui/scripts/cloud.core.snapshot.js | 6 +++--- ui/scripts/cloud.core.volume.js | 21 +++++++-------------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ui/jsp/volume.jsp b/ui/jsp/volume.jsp index 4cc5c9c7977..7ffac733d85 100644 --- a/ui/jsp/volume.jsp +++ b/ui/jsp/volume.jsp @@ -666,8 +666,18 @@ dictionary = {
- +
+
+
+ :
+
+
+
+
+
+
+
:
@@ -677,7 +687,7 @@ dictionary = {
-
+
:
@@ -687,7 +697,7 @@ dictionary = {
-
+
:
@@ -697,7 +707,7 @@ dictionary = {
-
+
:
diff --git a/ui/scripts/cloud.core.snapshot.js b/ui/scripts/cloud.core.snapshot.js index 84e9965ee1e..e63f6a67993 100644 --- a/ui/scripts/cloud.core.snapshot.js +++ b/ui/scripts/cloud.core.snapshot.js @@ -168,9 +168,9 @@ function snapshotJsonToDetailsTab() { }); $thisTab.find("#id").text(fromdb(jsonObj.id)); - $thisTab.find("#name").text(fromdb(jsonObj.name)); - $thisTab.find("#state").text(fromdb(jsonObj.state)); - $thisTab.find("#volume_name").text(fromdb(jsonObj.volumename)); + $thisTab.find("#name").text(fromdb(jsonObj.name)); + $thisTab.find("#volume_name").text(fromdb(jsonObj.volumename)); + $thisTab.find("#state").text(fromdb(jsonObj.state)); $thisTab.find("#interval_type").text(fromdb(jsonObj.intervaltype)); $thisTab.find("#account").text(fromdb(jsonObj.account)); $thisTab.find("#domain").text(fromdb(jsonObj.domain)); diff --git a/ui/scripts/cloud.core.volume.js b/ui/scripts/cloud.core.volume.js index a4ce5d38228..6ad23ee198e 100644 --- a/ui/scripts/cloud.core.volume.js +++ b/ui/scripts/cloud.core.volume.js @@ -518,7 +518,8 @@ function volumeSnapshotJSONToTemplate(jsonObj, template) { template.find("#grid_header_title").text(fromdb(jsonObj.name)); template.find("#id").text(fromdb(jsonObj.id)); template.find("#name").text(fromdb(jsonObj.name)); - template.find("#volumename").text(fromdb(jsonObj.volumename)); + template.find("#volumename").text(fromdb(jsonObj.volumename)); + template.find("#state").text(fromdb(jsonObj.state)); template.find("#intervaltype").text(fromdb(jsonObj.intervaltype)); template.find("#account").text(fromdb(jsonObj.account)); template.find("#domain").text(fromdb(jsonObj.domain)); @@ -526,23 +527,15 @@ function volumeSnapshotJSONToTemplate(jsonObj, template) { var $actionLink = template.find("#action_link"); bindActionLink($actionLink); - /* - $actionLink.bind("mouseover", function(event) { - $(this).find("#action_menu").show(); - return false; - }); - $actionLink.bind("mouseout", function(event) { - $(this).find("#action_menu").hide(); - return false; - }); - */ var $actionMenu = $actionLink.find("#action_menu"); $actionMenu.find("#action_list").empty(); - - buildActionLinkForSubgridItem("label.action.create.volume", volumeSnapshotActionMap, $actionMenu, template); + + if(jsonObj.state == "BackedUp") { + buildActionLinkForSubgridItem("label.action.create.volume", volumeSnapshotActionMap, $actionMenu, template); + buildActionLinkForSubgridItem("label.action.create.template", volumeSnapshotActionMap, $actionMenu, template); + } buildActionLinkForSubgridItem("label.action.delete.snapshot", volumeSnapshotActionMap, $actionMenu, template); - buildActionLinkForSubgridItem("label.action.create.template", volumeSnapshotActionMap, $actionMenu, template); } function volumeClearRightPanel() {