Selaa lähdekoodia

AMBARI-258. Start/Stop service show services that are not dependent on the service being worked on

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1339761 13f79535-47bb-0310-9956-ffa450edef68
Ramya Sunil 13 vuotta sitten
vanhempi
commit
4d7eb0150c
2 muutettua tiedostoa jossa 16 lisäystä ja 1 poistoa
  1. 3 0
      CHANGES.txt
  2. 13 1
      hmc/js/manageServices.js

+ 3 - 0
CHANGES.txt

@@ -2,6 +2,9 @@ Ambari Change log
 
 Release 0.x.x - unreleased
 
+  AMBARI-258. Start/Stop service show services that are not dependent on the 
+  service being worked on (Vinod via ramya)
+
   AMBARI-251. Oozie link is not displayed even when Oozie is installed 
   (vgogate via ramya)
 

+ 13 - 1
hmc/js/manageServices.js

@@ -208,7 +208,7 @@ function getServiceConfigurationMarkup( serviceConfigurationData ) {
 
 function serviceManagementActionClickHandler( action, serviceName ) {
 
-  var affectedServices;
+  var affectedServices = [];
 
   var confirmationDataPanelTitle = '';
   var confirmationDataPanelBodyContent = '';
@@ -302,7 +302,19 @@ function serviceManagementActionClickHandler( action, serviceName ) {
     confirmationDataPanelBodyContent = "We are now going to stop all the services in the cluster";
   }
 
+  // Add the list of dependencies
   if(action =='start' || action == 'stop') {
+
+    // Clean up the affected-services list to only include appropriate installed long-running services
+    var deps = affectedServices;
+    affectedServices = [];
+    for (dep in deps) {
+      var svc = deps[dep];
+      if (clusterServices.hasOwnProperty(svc) && (clusterServices[svc].isEnabled == 1) && clusterServices[svc].attributes.runnable ) {
+        affectedServices.push(svc);
+      }
+    }
+
     var dependencyMarkup = "";
     for (affectedSrvc in affectedServices) {
       if (clusterServices[affectedServices[affectedSrvc]].attributes.runnable) {