Просмотр исходного кода

AMBARI-3816 UI tweaks with stop/start actions in stale_config restart indicator. (ababiichuk)

aBabiichuk 11 лет назад
Родитель
Сommit
1e02ae7861

+ 3 - 3
ambari-web/app/controllers/main/host/details.js

@@ -972,12 +972,12 @@ App.MainHostDetailsController = Em.Controller.extend({
     var staleComponents = this.get('content.hostComponents').filterProperty('staleConfigs', true);
     var commandName = "stop_component";
     if(e.context) {
-      if(!staleComponents.findProperty('workStatus','INSTALLED')){
+      if(!staleComponents.findProperty('workStatus','STARTED')){
         return;
       }
-    }else {
+    } else {
       commandName = "start_component";
-      if(!staleComponents.findProperty('workStatus','STARTED')){
+      if(!staleComponents.findProperty('workStatus','INSTALLED')){
         return;
       }
     };

+ 2 - 2
ambari-web/app/messages.js

@@ -1317,8 +1317,8 @@ Em.I18n.translations = {
   'hosts.host.details.hostActions':'Host Actions',
   'hosts.host.details.needToRestart':'Host needs {0} components restarted',
   'hosts.host.details.needToRestart.button':'Restart components',
-  'hosts.host.details.needToRestart.stopButton':'Stop components',
-  'hosts.host.details.needToRestart.startButton':'Start components',
+  'hosts.host.details.needToRestart.stopButton':'Stop Components',
+  'hosts.host.details.needToRestart.startButton':'Start Components',
   'hosts.host.details.deleteHost':'Delete Host',
   'hosts.host.details.startAllComponents':'Start All Components',
   'hosts.host.details.stopAllComponents':'Stop All Components',

+ 3 - 0
ambari-web/app/styles/application.less

@@ -3106,6 +3106,9 @@ background: url(	data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByU
       width: 160px;
       height: 30px;
     }
+    .icon-refresh {
+      color: #FDB82F;
+    }
   }
 
   .host-components .btn-group {

+ 2 - 2
ambari-web/app/templates/main/host/summary.hbs

@@ -31,11 +31,11 @@
               <div class="alert alert-warning clearfix">
                 <i class="icon-refresh"></i> {{view.needToRestartMessage}}
                 <br/>
-                <button {{bindAttr class=":btn :btn-warning :restart-components :pull-left view.stopComponentsIsDisabled:disabled" }} {{action restartComponents view.isStopCommand target="controller"}}>
+                <button {{bindAttr class=":btn :restart-components :pull-left view.stopComponentsIsDisabled::btn-danger view.stopComponentsIsDisabled:disabled" }} {{action restartComponents view.isStopCommand target="controller"}}>
                   {{t hosts.host.details.needToRestart.stopButton}}
                 </button>
                  <span class="restart-components  pull-left">&nbsp</span>
-                 <button {{bindAttr class=":btn :btn-warning :restart-components :pull-left view.startComponentsIsDisabled:disabled" }} {{action restartComponents target="controller"}}>
+                 <button {{bindAttr class=":btn :restart-components :pull-left view.startComponentsIsDisabled::btn-success view.startComponentsIsDisabled:disabled" }} {{action restartComponents target="controller"}}>
                   {{t hosts.host.details.needToRestart.startButton}}
                  </button>
               </div>

+ 2 - 2
ambari-web/app/templates/main/service/info/configs.hbs

@@ -25,11 +25,11 @@
             <div class="alert alert-warning clearfix">
               <i class="icon-refresh"></i> {{{view.needToRestartMessage}}} <a href="#" {{action showComponentsShouldBeRestarted target="controller"}}>{{view.componentsCount}} {{t common.components}}</a> {{t on}} <a href="#" {{action showHostsShouldBeRestarted target="controller"}}>{{view.hostsCount}} {{t dashboard.services.hosts}}</a> {{t services.service.config.restartService.needToRestartEnd}}
 
-              <button {{bindAttr class=":btn :btn-warning :restart-components :pull-right view.startComponentsIsDisabled:disabled" }} {{action restartComponents target="controller"}}>
+              <button {{bindAttr class=":btn :restart-components :pull-right view.startComponentsIsDisabled::btn-success view.startComponentsIsDisabled:disabled" }} {{action restartComponents target="controller"}}>
                 {{t hosts.host.details.needToRestart.startButton}}
               </button>
               <span class="restart-components pull-right">&nbsp</span>
-              <button {{bindAttr class=":btn :btn-warning :restart-components :pull-right view.stopComponentsIsDisabled:disabled" }} {{action restartComponents view.isStopCommand target="controller"}}>
+              <button {{bindAttr class=":btn :restart-components :pull-right view.stopComponentsIsDisabled::btn-danger view.stopComponentsIsDisabled:disabled" }} {{action restartComponents view.isStopCommand target="controller"}}>
                 {{t hosts.host.details.needToRestart.stopButton}}
               </button>
             </div>

+ 4 - 4
ambari-web/app/views/main/host/summary.js

@@ -40,18 +40,18 @@ App.MainHostSummaryView = Em.View.extend({
 
   stopComponentsIsDisabled: function () {
     var staleComponents = this.get('sortedComponents').filterProperty('staleConfigs', true);
-    if(!staleComponents.findProperty('workStatus','INSTALLED')){
+    if(!staleComponents.findProperty('workStatus','STARTED')){
       return true;
-    }else{
+    } else {
       return false;
     }
   }.property('sortedComponents.@each.workStatus'),
 
   startComponentsIsDisabled:function () {
     var staleComponents = this.get('sortedComponents').filterProperty('staleConfigs', true);
-    if(!staleComponents.findProperty('workStatus','STARTED')){
+    if(!staleComponents.findProperty('workStatus','INSTALLED')){
       return true;
-    }else{
+    } else {
       return false;
     }
   }.property('sortedComponents.@each.workStatus'),