You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/15 20:20:22 UTC

[07/10] git commit: AMBARI-6878. Rebalancer: The UI still shows the rebalancer as running though its completed. (Max Shepel via alexantonenko)

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

Branch: refs/heads/branch-alerts-dev
Commit: b8a1e5f57934c2b86a901dfc339f09c16edae666
Parents: 3394a03
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri Aug 15 18:12:41 2014 +0300
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Aug 15 14:20:00 2014 -0400

----------------------------------------------------------------------
 .../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/b8a1e5f5/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/b8a1e5f5/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);