ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-6878. Rebalancer: The UI still shows the rebalancer as running though its completed. (Max Shepel via alexantonenko)
Date Fri, 15 Aug 2014 15:14:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ea915a0d2 -> 91d69358e


AMBARI-6878. Rebalancer: The UI still shows the rebalancer as running though its completed.
(Max Shepel via alexantonenko)


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

Branch: refs/heads/trunk
Commit: 91d69358e40ab4469261c13eced212c4c938054f
Parents: ea915a0
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri Aug 15 18:12:41 2014 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri Aug 15 18:12:41 2014 +0300

----------------------------------------------------------------------
 .../app/templates/common/host_progress_popup.hbs    |  6 ++++--
 ambari-web/app/utils/host_progress_popup.js         | 16 ++++++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/91d69358/ambari-web/app/templates/common/host_progress_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/host_progress_popup.hbs b/ambari-web/app/templates/common/host_progress_popup.hbs
index 9a57c05..d598ec7 100644
--- a/ambari-web/app/templates/common/host_progress_popup.hbs
+++ b/ambari-web/app/templates/common/host_progress_popup.hbs
@@ -202,7 +202,7 @@
                     {{#if view.openedTask.isRebalanceHDFSTask }}
                       <h5>{{t services.hdfs.rebalance.title}}</h5>
                       <div class="progresspopup-rebalancehdfs">
-                        <div class="progress progress-striped active">
+                        <div {{bindAttr class=":progress view.openedTask.isInProgress:progress-striped
view.openedTask.barColor :active"}}>
                           <div class="bar" {{bindAttr style="view.openedTask.completionProgressStyle"}}></div>
                         </div>
                       </div>
@@ -212,7 +212,9 @@
                           {{view.openedTask.dataLeft}} left /
                           {{view.openedTask.dataBeingMoved}} being processed
                         </div>
-                        <button class="btn btn-danger pull-right" {{action stopRebalanceHDFS}}>{{t
common.cancel}}</button>
+                        {{#if view.openedTask.isNotComplete}}
+                          <button class="btn btn-danger pull-right" {{action stopRebalanceHDFS}}>{{t
common.cancel}}</button>
+                        {{/if}}
                       </div>
                       <hr>
                     {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/91d69358/ambari-web/app/utils/host_progress_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/host_progress_popup.js b/ambari-web/app/utils/host_progress_popup.js
index 36e9c30..1d3b184 100644
--- a/ambari-web/app/utils/host_progress_popup.js
+++ b/ambari-web/app/utils/host_progress_popup.js
@@ -461,7 +461,8 @@ App.HostPopup = Em.Object.create({
               newHostInfo.logTasks.forEach(function (_task) {
                 var existTask = existTasks.findProperty('id', _task.Tasks.id);
                 if (existTask) {
-                  existTask.set('status', App.format.taskStatus(_task.Tasks.status));
+                  var status = _task.Tasks.status;
+                  existTask.set('status', App.format.taskStatus(status));
                   existTask.set('stdout', _task.Tasks.stdout);
                   existTask.set('stderr', _task.Tasks.stderr);
                   // Verified that this is needed.
@@ -477,10 +478,21 @@ App.HostPopup = Em.Object.create({
                     if (!structuredOut || structuredOut === 'null') {
                       structuredOut = {};
                     }
-                    
+
+                    var barColorMap = {
+                      'FAILED': 'progress-danger',
+                      'ABORTED': 'progress-warning',
+                      'TIMEDOUT': 'progress-warning',
+                      'IN_PROGRESS': 'progress-info',
+                      'COMPLETED': 'progress-success'
+                    };
+
                     existTask.set('dataMoved', structuredOut['dataMoved'] || '0');
                     existTask.set('dataLeft', structuredOut['dataLeft'] || '0');
                     existTask.set('dataBeingMoved', structuredOut['dataBeingMoved'] || '0');
+                    existTask.set('barColor', barColorMap[status]);
+                    existTask.set('isInProgress', status == 'IN_PROGRESS');
+                    existTask.set('isNotComplete', ['QUEUED', 'IN_PROGRESS'].contains(status));
                     existTask.set('completionProgressStyle', 'width:' + (structuredOut['completePercent']
|| 0) * 100 + '%;');
 
                     existTask.set('command', _task.Tasks.command);


Mime
View raw message