You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2016/02/11 01:22:36 UTC

ambari git commit: AMBARI-14881: Enable/Disable Custom Commands on Host Component page (goutamtadi via jaoki)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 20aaff5fa -> c98abf3a6


AMBARI-14881: Enable/Disable Custom Commands on Host Component page (goutamtadi via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: c98abf3a6489489b07481724f607b5bf3c684f5d
Parents: 20aaff5
Author: Jun Aoki <ja...@apache.org>
Authored: Wed Feb 10 16:22:25 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Wed Feb 10 16:22:25 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/templates/main/host/details/host_component.hbs | 2 +-
 ambari-web/app/views/main/host/details/host_component_view.js | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c98abf3a/ambari-web/app/templates/main/host/details/host_component.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/details/host_component.hbs b/ambari-web/app/templates/main/host/details/host_component.hbs
index 23cdb7c..69dc598 100644
--- a/ambari-web/app/templates/main/host/details/host_component.hbs
+++ b/ambari-web/app/templates/main/host/details/host_component.hbs
@@ -134,7 +134,7 @@
         {{/if}}
 
       {{#each command in view.customCommands}}
-        <li>
+        <li {{bindAttr class="command.disabled:disabled"}}>
           <a href="javascript:void(null)" {{action "executeCustomCommand" command target="controller" href=true}}>{{command.label}}</a>
         </li>
       {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c98abf3a/ambari-web/app/views/main/host/details/host_component_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details/host_component_view.js b/ambari-web/app/views/main/host/details/host_component_view.js
index 9aabe42..bef5517 100644
--- a/ambari-web/app/views/main/host/details/host_component_view.js
+++ b/ambari-web/app/views/main/host/details/host_component_view.js
@@ -329,14 +329,15 @@ App.HostComponentView = Em.View.extend({
         return;
       }
 
-      var isContextPresent = command in App.HostComponentActionMap.getMap(self) && App.HostComponentActionMap.getMap(self)[command].context;
+      var commandMap = App.HostComponentActionMap.getMap(self)[command];
       customCommands.push({
         label: self.getCustomCommandLabel(command),
         service: component.get('serviceName'),
         hosts: hostComponent.get('hostName'),
-        context: isContextPresent ? App.HostComponentActionMap.getMap(self)[command].context : null,
+        context: (!!commandMap && !!commandMap.context) ? commandMap.context : null,
         component: component.get('componentName'),
-        command: command
+        command: command,
+        disabled: !!commandMap ? !!commandMap.disabled : false
       });
     });