You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/02/18 14:33:48 UTC

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

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/dcebcca6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dcebcca6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dcebcca6

Branch: refs/heads/branch-dev-patch-upgrade
Commit: dcebcca60d47743176519b7758b86505263e39a7
Parents: b53a13f
Author: Jun Aoki <ja...@apache.org>
Authored: Wed Feb 17 18:52:38 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Wed Feb 17 18:52:38 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/dcebcca6/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 00db8d1..60031de 100644
--- a/ambari-web/app/templates/main/host/details/host_component.hbs
+++ b/ambari-web/app/templates/main/host/details/host_component.hbs
@@ -143,7 +143,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/dcebcca6/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 6205604..d059498 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
@@ -311,14 +311,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
       });
     });