You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/02/20 23:02:57 UTC

svn commit: r1448437 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/main/service/item.js ambari-web/app/templates/main/service/item.hbs ambari-web/app/views/main/service/item.js

Author: yusaku
Date: Wed Feb 20 22:02:56 2013
New Revision: 1448437

URL: http://svn.apache.org/r1448437
Log:
AMBARI-1454. Service page: add "Reassign <Master Component>" action items to "Maintenance" pulldown. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js
    incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/service/item.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1448437&r1=1448436&r2=1448437&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Feb 20 22:02:56 2013
@@ -12,6 +12,9 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-1454. Service page: add "Reassign <Master Component>" action items
+ to "Maintenance" pulldown. (yusaku)
+
  AMBARI-1349. Expose host-specific Nagios alerts in Ambari Web. (yusaku)
 
  AMBARI-1294. Add isEmpty() query operator support. (jspeidel)

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js?rev=1448437&r1=1448436&r2=1448437&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js Wed Feb 20 22:02:56 2013
@@ -253,24 +253,34 @@ App.MainServiceItemController = Em.Contr
   },
 
   /**
+   * On click callback for <code>Reassign <master component></code> button
+   * @param hostComponent
+   */
+  reassignMaster: function (hostComponent) {
+    console.log('In Reassign Master', hostComponent);
+    App.ModalPopup.show({
+      header: 'Reassign Master Wizard',
+      body: 'Reassign Master Wizard',
+      secondary: false,
+      onPrimary: function() {
+        this.hide();
+      }
+    });
+  },
+
+  /**
    * On click callback for <code>action</code> dropdown menu
+   * Calls runSmokeTest, runRebalancer, runCompaction or reassignMaster depending on context
    * @param event
    */
   doAction: function (event) {
     if ($(event.target).hasClass('disabled') || $(event.target.parentElement).hasClass('disabled')) {
       return;
     }
-    var methodName = event.context;
-    switch (methodName) {
-      case 'runRebalancer':
-        this.runRebalancer();
-        break;
-      case 'runCompaction':
-        this.runCompaction();
-        break;
-      case 'runSmokeTest':
-        this.runSmokeTest();
-        break;
+    var methodName = event.context.action;
+    var context = event.context.context;
+    if (methodName) {
+      this[methodName](context);
     }
   }
 })
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs?rev=1448437&r1=1448436&r2=1448437&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/item.hbs Wed Feb 20 22:02:56 2013
@@ -29,7 +29,7 @@
       <!-- dropdown menu links -->
       {{#each option in view.maintenance}}
       <li {{bindAttr class="controller.content.isStopDisabled:disabled"}}>
-        <a {{action "doAction" option.action target="controller" href=true}}>{{option.label}}</a>
+        <a {{action "doAction" option target="controller" href=true}}>{{option.label}}</a>
       </li>
       {{/each}}
     </ul>

Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/item.js?rev=1448437&r1=1448436&r2=1448437&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/item.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/item.js Wed Feb 20 22:02:56 2013
@@ -32,6 +32,9 @@ App.MainServiceItemView = Em.View.extend
 //        break;
       default:
         options.push({action: 'runSmokeTest', 'label': Em.I18n.t('services.service.actions.run.smoke')});
+        this.get('controller.content.hostComponents').filterProperty('isMaster').forEach (function (hostComponent){
+          options.push({action: 'reassignMaster', context: hostComponent, 'label': Em.I18n.t('services.service.actions.reassign.master').format(hostComponent.get('displayName'))});
+        })
     }
     return options;
   }.property('controller.content'),