Browse Source

AMBARI-6588. Decommission/Recommission BG window UI defects.(xiwang)

Xi Wang 10 years ago
parent
commit
9100e08a7b

+ 2 - 0
ambari-web/app/controllers/global/background_operations_controller.js

@@ -123,6 +123,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
    */
   callBackFilteredByRequest: function (data, ajaxQuery, params) {
     var requestId = data.Requests.id;
+    var requestInputs = data.Requests.inputs;
     var request = this.get('services').findProperty('id', requestId);
     var hostsMap = {};
     var previousTaskStatusMap = request.get('previousTaskStatusMap');
@@ -130,6 +131,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
     data.tasks.forEach(function (task) {
       var host = hostsMap[task.Tasks.host_name];
       task.Tasks.request_id = requestId;
+      task.Tasks.request_inputs = requestInputs;
       if (host) {
         host.logTasks.push(task);
         host.isModified = (host.isModified) ? true : previousTaskStatusMap[task.Tasks.id] !== task.Tasks.status;

+ 1 - 0
ambari-web/app/models/stack_service_component.js

@@ -212,3 +212,4 @@ App.StackServiceComponent.coHost = {
   'HIVE_METASTORE': 'HIVE_SERVER',
   'WEBHCAT_SERVER': 'HIVE_SERVER'
 };
+

+ 4 - 3
ambari-web/app/utils/helper.js

@@ -406,9 +406,10 @@ App.format = {
    * @memberof App.format
    * @method commandDetail
    * @param {string} command_detail
+   * @param {string} request_inputs
    * @return {string}
    */
-  commandDetail: function (command_detail) {
+  commandDetail: function (command_detail, request_inputs) {
     var detailArr = command_detail.split(' ');
     var self = this;
     var result = '';
@@ -417,9 +418,9 @@ App.format = {
       if (item.contains('/')) {
         item = item.split('/')[1];
       }
-      // ignore 'DECOMMISSION', command came from 'excluded/included'
       if (item == 'DECOMMISSION,') {
-        item = '';
+        // ignore text 'DECOMMISSION,'( command came from 'excluded/included'), here get the component name from request_inputs
+        item = (jQuery.parseJSON(request_inputs)) ? jQuery.parseJSON(request_inputs).slave_type : '';
       }
       if (self.components[item]) {
         result = result + ' ' + self.components[item];

+ 1 - 1
ambari-web/app/utils/host_progress_popup.js

@@ -298,7 +298,7 @@ App.HostPopup = Em.Object.create({
       id: _task.Tasks.id,
       hostName: _task.Tasks.host_name,
       command: ( _task.Tasks.command.toLowerCase() != 'service_check') ? _task.Tasks.command.toLowerCase() : '',
-      commandDetail: App.format.commandDetail(_task.Tasks.command_detail),
+      commandDetail: App.format.commandDetail(_task.Tasks.command_detail, _task.Tasks.request_inputs),
       status: App.format.taskStatus(_task.Tasks.status),
       role: App.format.role(_task.Tasks.role),
       stderr: _task.Tasks.stderr,