aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [13/50] [abbrv] git commit: Added a table to display task summary.
Date Sat, 05 Apr 2014 00:04:59 GMT
Added a table to display task summary.


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/419ff53b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/419ff53b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/419ff53b

Branch: refs/heads/mansu/job_page
Commit: 419ff53bd78a062469c3d860f4164f9ee1a435cc
Parents: 2034153
Author: Suman Karumuri <skarumuri@twitter.com>
Authored: Thu Mar 27 23:33:38 2014 -0700
Committer: Suman Karumuri <skarumuri@twitter.com>
Committed: Thu Mar 27 23:33:38 2014 -0700

----------------------------------------------------------------------
 .../apache/aurora/scheduler/http/ui/job.html    |  8 +++++--
 .../aurora/scheduler/http/ui/js/controllers.js  | 25 +++++++++++++-------
 2 files changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/419ff53b/src/main/resources/org/apache/aurora/scheduler/http/ui/job.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/job.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/job.html
index 58f081c..08f479a 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/job.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/job.html
@@ -16,8 +16,12 @@
         </div>
       </div>
 
-      <div>
-        {{schedulingDetails}}
+      <div class='span8 center'>
+        <smart-table config='taskSummaryTableConfig'
+                     columns='taskSummaryTableColumns'
+                     rows='taskSummary'
+                     class='table table-striped table-hover table-bordered table-condensed'>
+        </smart-table>
       </div>
 
       <div class='container-fluid'>

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/419ff53b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
index 8268a93..45a522d 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
@@ -285,7 +285,18 @@ auroraUIControllers.controller('JobController',
     $scope.environment = $routeParams.environment;
     $scope.job = $routeParams.job;
 
-    $scope.schedulingDetails = [];
+    $scope.taskSummary = [];
+    $scope.taskSummaryTableColumns = [
+      {label: 'Instances', map: 'range', isSortable: false},
+      {label: 'Details', map: 'schedulingDetails', isSortable: false}
+    ];
+
+    //TODO: Share?
+    $scope.taskSummaryTableConfig = {
+      isPaginationEnabled: false,
+      isGlobalSearchActivated: false,
+      selectionMode: 'none'
+    };
 
     $scope.activeTasksTableConfig = globalTableConfig;
     $scope.completedTasksTableConfig = globalTableConfig;
@@ -330,8 +341,8 @@ auroraUIControllers.controller('JobController',
 
       console.log(response);
 
-      $scope.schedulingDetails = summarizeActiveTaskConfigs(response.tasks);
-      console.log($scope.schedulingDetails);
+      $scope.taskSummary = summarizeActiveTaskConfigs(response.tasks);
+      console.log($scope.taskSummary);
 
       var tasks = _.chain(response.tasks)
         .map(function (task) {
@@ -343,9 +354,7 @@ auroraUIControllers.controller('JobController',
             return taskEvent.timestamp;
           });
 
-          var lastTaskTimestamp = sortedTaskEvents.length !== 0
-            ? _.last(sortedTaskEvents).timestamp
-            : 0;
+          var lastTransition = _.isEmpty(sortedTaskEvents) ? _.last(sortedTaskEvents).timestamp
: 0;
 
           var runningTaskEvent = sortedTaskEvents.length === 0 ? undefined : getRunningTaskEvent(task);
 
@@ -353,10 +362,10 @@ auroraUIControllers.controller('JobController',
             instanceId: task.assignedTask.instanceId,
             status: _.invert(ScheduleStatus)[task.status],
             host: task.assignedTask.slaveHost || '',
-            latestActivity: lastTaskTimestamp,
+            latestActivity: lastTransition,
             duration: isActive || _.isUndefined(runningTaskEvent)
               ? 0
-              : lastTaskTimestamp - runningTaskEvent.timestamp,
+              : lastTransition - runningTaskEvent.timestamp,
             isActive: isActive,
             taskId: task.assignedTask.taskId,
             taskEvents: toTaskEvents(sortedTaskEvents)


Mime
View raw message