Quellcode durchsuchen

AMBARI-531. Remove/disable reconfigure option for Sqoop, Pig, Ganglia and Templeton (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347203 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K vor 13 Jahren
Ursprung
Commit
7c818ba0d9
3 geänderte Dateien mit 33 neuen und 7 gelöschten Zeilen
  1. 2 0
      CHANGES.txt
  2. 6 1
      hmc/css/manageServices.css
  3. 25 6
      hmc/js/manageServices.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 
 Release 0.1.x - unreleased
 Release 0.1.x - unreleased
 
 
+  AMBARI-531. Remove/disable reconfigure option for Sqoop, Pig, Ganglia and Templeton (Yusaku via Vikram)
+
   AMBARI-529. Fix Advanced Config: HDFS reserved space is in bytes. Too many bytes to count. (Hitesh via Vikram)
   AMBARI-529. Fix Advanced Config: HDFS reserved space is in bytes. Too many bytes to count. (Hitesh via Vikram)
 
 
   AMBARI-530. HMC UI shows undefined for nodes after single node install (Yusaku via Vikram)
   AMBARI-530. HMC UI shows undefined for nodes after single node install (Yusaku via Vikram)

+ 6 - 1
hmc/css/manageServices.css

@@ -122,9 +122,14 @@ a.serviceManagementEntryName {
 }
 }
 
 
 .serviceManagementEntryActionReconfigure {
 .serviceManagementEntryActionReconfigure {
-	 width:20px;
+  width:20px;
 }
 }
 
 
+.serviceManagementEntryActionReconfigure.disabled {
+  visibility:hidden;
+}
+
+
 #serviceManagementGlobalActionsDivId {
 #serviceManagementGlobalActionsDivId {
 	margin-top:40px;
 	margin-top:40px;
   margin-left:90px;
   margin-left:90px;

+ 25 - 6
hmc/js/manageServices.js

@@ -616,19 +616,38 @@ function generateServiceManagementEntryMarkup( serviceName, serviceInfo ) {
         serviceManagementEntryAnchorCssClasses += 'serviceManagementEntryActionStop';
         serviceManagementEntryAnchorCssClasses += 'serviceManagementEntryActionStop';
         serviceManagementEntryIconCssClass = 'iconic-stop';
         serviceManagementEntryIconCssClass = 'iconic-stop';
       }
       }
-
+      else if ( serviceInfo.state == 'STOPPING') {
+        serviceManagementEntryAnchorName = 'start';
+        serviceManagementEntryAnchorTitle = 'Start';
+        serviceManagementEntryAnchorCssClasses += 'serviceManagementEntryActionStart disabled';
+        serviceManagementEntryIconCssClass = 'iconic-start disabled';
+      }
+      else if ( serviceInfo.state == 'STARTING') {
+        serviceManagementEntryAnchorName = 'stop';
+        serviceManagementEntryAnchorTitle = 'Stop';
+        serviceManagementEntryAnchorCssClasses += 'serviceManagementEntryActionStop disabled';
+        serviceManagementEntryIconCssClass = 'iconic-stop disabled';
+      }
+      
       generatedServiceManagementEntryMarkup += 
       generatedServiceManagementEntryMarkup += 
         '<a href="javascript:void(null)" name="' + serviceManagementEntryAnchorName + '" ' +
         '<a href="javascript:void(null)" name="' + serviceManagementEntryAnchorName + '" ' +
         'title="' + serviceManagementEntryAnchorTitle + '" ' +
         'title="' + serviceManagementEntryAnchorTitle + '" ' +
         'class="' + serviceManagementEntryAnchorCssClasses + '"><i class="' + serviceManagementEntryIconCssClass + '"></i></a> ';
         'class="' + serviceManagementEntryAnchorCssClasses + '"><i class="' + serviceManagementEntryIconCssClass + '"></i></a> ';
     }
     }
 
 
-    generatedServiceManagementEntryMarkup += 
-            '<a href="javascript:void(null)" name="reconfigure" title="Reconfigure" ' +
-               'class="btn serviceManagementEntryAction serviceManagementEntryActionReconfigure"><i class="iconic-cog"></i></a>' +
+    var notReconfigurable = [ 'PIG', 'SQOOP', 'OOZIE', 'TEMPLETON', 'GANGLIA' ];
+    var reconfigureClass;
+    if (globalYui.Array.indexOf(notReconfigurable, serviceName) >= 0) {
+      reconfigureClass = 'serviceManagementEntryActionReconfigure disabled';
+    } else {
+      reconfigureClass = 'serviceManagementEntryActionReconfigure';
+    }
+  
+    generatedServiceManagementEntryMarkup += '<a href="javascript:void(null)" name="reconfigure" title="Reconfigure" ' +
+              'class="btn serviceManagementEntryAction ' + reconfigureClass + '"><i class="iconic-cog"></i></a>' +
+            '</div>' +
           '</div>' +
           '</div>' +
-        '</div>' +
-      '</li>';
+        '</li>';
   }
   }
 
 
   return generatedServiceManagementEntryMarkup;
   return generatedServiceManagementEntryMarkup;