From 33e87159e5e23ff5d707f01ed4b0c57d8d28b5bb Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 21 Jun 2011 14:48:29 -0700 Subject: [PATCH] bug 10356: cloudStack UI - System Service Offerings page - (1) add a grid row "Default Use". (2) Hide Delete Action and Edit Action when Default Use is true. --- ui/jsp/systemserviceoffering.jsp | 13 ++++++++++++- ui/scripts/cloud.core.systemserviceoffering.js | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ui/jsp/systemserviceoffering.jsp b/ui/jsp/systemserviceoffering.jsp index 3521e55dd46..f48ed725b43 100644 --- a/ui/jsp/systemserviceoffering.jsp +++ b/ui/jsp/systemserviceoffering.jsp @@ -158,6 +158,17 @@ dictionary = {
+
+
+ :
+
+
+
+
+
+
+ +
:
@@ -170,7 +181,7 @@ dictionary = {
-
+
:
diff --git a/ui/scripts/cloud.core.systemserviceoffering.js b/ui/scripts/cloud.core.systemserviceoffering.js index 0e61edbb300..395dc1fa77a 100644 --- a/ui/scripts/cloud.core.systemserviceoffering.js +++ b/ui/scripts/cloud.core.systemserviceoffering.js @@ -330,6 +330,8 @@ function systemServiceOfferingJsonToDetailsTab() { $thisTab.find("#tags").text(fromdb(jsonObj.tags)); $thisTab.find("#tags_edit").val(fromdb(jsonObj.tags)); + + setBooleanReadField(jsonObj.defaultuse, $thisTab.find("#defaultuse")); $thisTab.find("#domain").text(fromdb(jsonObj.domain)); $thisTab.find("#domain_edit").val(fromdb(jsonObj.domainid)); @@ -338,9 +340,16 @@ function systemServiceOfferingJsonToDetailsTab() { //actions *** var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu"); - $actionMenu.find("#action_list").empty(); - buildActionLinkForTab("label.action.edit.service.offering", systemServiceOfferingActionMap, $actionMenu, $midmenuItem1, $thisTab); - buildActionLinkForTab("label.action.delete.service.offering", systemServiceOfferingActionMap, $actionMenu, $midmenuItem1, $thisTab); + $actionMenu.find("#action_list").empty(); + var noAvailableActions = true; + if(jsonObj.defaultuse == false) { + buildActionLinkForTab("label.action.edit.service.offering", systemServiceOfferingActionMap, $actionMenu, $midmenuItem1, $thisTab); + buildActionLinkForTab("label.action.delete.service.offering", systemServiceOfferingActionMap, $actionMenu, $midmenuItem1, $thisTab); + noAvailableActions = false; + } + if(noAvailableActions == true) { + $actionMenu.find("#action_list").append($("#no_available_actions").clone().show()); + } $thisTab.find("#tab_spinning_wheel").hide(); $thisTab.find("#tab_container").show(); @@ -364,7 +373,8 @@ function systemServiceOfferingClearDetailsTab() { $thisTab.find("#offerha").text(""); $thisTab.find("#offerha_edit").val(""); $thisTab.find("#limitcpuuse").text(""); - $thisTab.find("#tags").text(""); + $thisTab.find("#tags").text(""); + $thisTab.find("#defaultuse").text(""); $thisTab.find("#domain").text(""); $thisTab.find("#domain_edit").val(""); $thisTab.find("#created").text("");