You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2014/01/16 23:16:48 UTC

git commit: AMBARI-4326. Move service stop start action buttons into Service Actions menu. (srimanth)

Updated Branches:
  refs/heads/trunk 1fb20653b -> 44f4f9198


AMBARI-4326. Move service stop start action buttons into Service Actions menu. (srimanth)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/44f4f919
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/44f4f919
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/44f4f919

Branch: refs/heads/trunk
Commit: 44f4f91983da4c2dedb0bc03772c2fe816198926
Parents: 1fb2065
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Jan 16 14:06:35 2014 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Jan 16 14:16:38 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/messages.js                     |  2 +-
 ambari-web/app/styles/application.less         |  6 ++++
 ambari-web/app/templates/main/service/item.hbs | 35 ++++++++++++---------
 ambari-web/app/views/main/service/item.js      | 19 +++++------
 4 files changed, 37 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/44f4f919/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e0af114..90382c4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -985,7 +985,7 @@ Em.I18n.translations = {
   'services.service.summary.historyServer': 'History Server Web UI',
   'services.service.actions.run.rebalancer':'Run Rebalancer',
   'services.service.actions.run.compaction':'Run Compaction',
-  'services.service.actions.run.smoke':'Run {0} Service Check',
+  'services.service.actions.run.smoke':'Run Service Check',
   'services.service.actions.reassign.master':'Move {0}',
   'services.service.actions.reassign.master.hive':'Move HiveServer2, WebHCat Server, MySQL Server',
   'services.service.actions.manage_configuration_groups':'Manage Configuration Groups...',

http://git-wip-us.apache.org/repos/asf/ambari/blob/44f4f919/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 006ab4e..8d8fd35 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2147,6 +2147,12 @@ width:100%;
     a {
       cursor: pointer;
     }
+    .icon-play.enabled {
+      color: @green;
+    }
+    .icon-stop.enabled{
+      color: red;
+    }
   }
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44f4f919/ambari-web/app/templates/main/service/item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/item.hbs b/ambari-web/app/templates/main/service/item.hbs
index 2eb5bcc..53d812f 100644
--- a/ambari-web/app/templates/main/service/item.hbs
+++ b/ambari-web/app/templates/main/service/item.hbs
@@ -48,6 +48,26 @@
       </a>
       <ul class="dropdown-menu">
         <!-- dropdown menu links -->
+
+        <!-- Start/Stop service actions -->
+        {{#if controller.isServiceRestartable}}
+          <li {{bindAttr class="controller.isStartDisabled:disabled"}}>
+            <a href="javascript:void(null)" {{bindAttr class="controller.isStartDisabled:disabled" }}
+              {{action "startService" target="controller"}}>
+              <i {{bindAttr class=":icon-play controller.isStartDisabled:disabled:enabled" }}></i>
+              {{t services.service.start}}
+            </a>
+          </li>
+          <li {{bindAttr class="controller.isStopDisabled:disabled"}}>
+            <a href="javascript:void(null)" {{bindAttr class="controller.isStopDisabled:disabled" }}
+              data-toggle="modal" {{action "stopService" target="controller"}}>
+              <i {{bindAttr class=":icon-stop controller.isStopDisabled:disabled:enabled" }}></i>
+              {{t services.service.stop}}
+            </a>
+          </li>
+        {{/if}}
+
+        <!-- Other service actions -->
         {{#each option in view.maintenance}}
         <li {{bindAttr class="option.disabled:disabled"}}>
           <a {{action "doAction" option target="controller" href=true}}>{{option.label}}</a>
@@ -56,21 +76,6 @@
       </ul>
     </div>
   {{/if}}
-  {{#if controller.isServiceRestartable}}
-	  <a href="javascript:void(null)" {{bindAttr class=":btn controller.isStartDisabled:disabled:btn-success" }}
-	     data-toggle="modal" {{action "startService" target="controller"}}>
-	    <i class="icon-play"></i>
-	    {{t services.service.start}}
-	  </a>
-	  <a href="javascript:void(null)" {{bindAttr class=":btn controller.isStopDisabled:disabled:btn-danger" }}
-	     data-toggle="modal" {{action "stopService" target="controller"}}>
-	    <i class="icon-stop icon-white"></i>
-	    {{t services.service.stop}}
-	  </a>
-	{{else}}
-	  <span>&nbsp;</span>
-	{{/if}}
-  </span>
 </div>
 {{/if}}
 {{outlet}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/44f4f919/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index d1792da..546afa1 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -28,6 +28,15 @@ App.MainServiceItemView = Em.View.extend({
     var allMasters = this.get('controller.content.hostComponents').filterProperty('isMaster').mapProperty('componentName').uniq();
     var disabled = this.get('controller.isStopDisabled');
     var serviceName = service.get('serviceName');
+    // Restart All action
+    options.push({action:'restartAllHostComponents', context: serviceName, 'label': Em.I18n.t('restart.service.all'), disabled: false});
+    // Rolling Restart action
+    var rrComponentName = batchUtils.getRollingRestartComponentName(serviceName);
+    if (rrComponentName) {
+      var label = Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(rrComponentName));
+      options.push({action:'rollingRestart', context: rrComponentName, 'label': label, disabled: false});
+    }
+    // Service Check and Reassign Master actions
     switch (serviceName) {
       case 'GANGLIA':
       case 'NAGIOS':
@@ -44,15 +53,7 @@ App.MainServiceItemView = Em.View.extend({
           })
         }
       default:
-        options.push({action: 'runSmokeTest', 'label': Em.I18n.t('services.service.actions.run.smoke').format(service.get('serviceName')), disabled:disabled});
-    }
-
-    options.push({action:'restartAllHostComponents', context: serviceName, 'label': Em.I18n.t('restart.service.all'), disabled: false});
-
-    var rrComponentName = batchUtils.getRollingRestartComponentName(serviceName);
-    if (rrComponentName) {
-      var label = Em.I18n.t('rollingrestart.dialog.title').format(App.format.role(rrComponentName));
-      options.push({action:'rollingRestart', context: rrComponentName, 'label': label, disabled: false});
+        options.push({action: 'runSmokeTest', 'label': Em.I18n.t('services.service.actions.run.smoke'), disabled:disabled});
     }
     return options;
   }.property('controller.content', 'controller.isStopDisabled'),