aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [46/50] [abbrv] git commit: Now showing taskId on clicking showSummary.
Date Sat, 05 Apr 2014 00:05:32 GMT
Now showing taskId on clicking showSummary.


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

Branch: refs/heads/mansu/job_page
Commit: 6a44f6c766f50369b0f9136541db763fb8820611
Parents: f6d57a3
Author: Suman Karumuri <skarumuri@twitter.com>
Authored: Fri Apr 4 12:25:49 2014 -0700
Committer: Suman Karumuri <skarumuri@twitter.com>
Committed: Fri Apr 4 12:25:49 2014 -0700

----------------------------------------------------------------------
 .../aurora/scheduler/http/ui/js/controllers.js  | 40 +++++++++++++-------
 1 file changed, 27 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6a44f6c7/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 2973720..503575e 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
@@ -297,6 +297,13 @@ auroraUIControllers.controller('JobController',
     $scope.toggleSummaryVisibility = function () {
       $scope.showSummary = !$scope.showSummary;
       $scope.summaryButtonText = $scope.showSummary ? hideSummary : showSummary;
+
+      $scope.activeTasksTableColumns = $scope.showSummary
+        ? addColumn(2, taskColumns, taskIdColumn)
+        : taskColumns;
+      $scope.completedTasksTableColumns = $scope.showSummary
+        ? addColumn(3, completedTaskColumns, taskIdColumn) :
+        completedTaskColumns;
     };
 
     var taskTableConfig = {
@@ -313,23 +320,30 @@ auroraUIControllers.controller('JobController',
     var taskColumns = [
       {label: 'Instance', map: 'instanceId'},
       {label: 'Status', map: 'status', cellTemplateUrl: '/taskStatus.html'},
-      {label: 'Host', map: 'host', cellTemplateUrl: '/taskSandbox.html'},
+      {label: 'Host', map: 'host', cellTemplateUrl: '/taskSandbox.html'}
     ];
 
+    var completedTaskColumns = addColumn(2,
+      taskColumns,
+      {label: 'Running duration',
+        map: 'duration',
+        formatFunction: function (duration) {
+          return moment(moment().subtract(duration)).fromNow(true);
+        }
+      });
+
+    var taskIdColumn = {label: 'Task ID', map: 'status', cellTemplateUrl: '/taskLink.html'};
+
     $scope.activeTasksTableColumns = taskColumns;
 
-    $scope.completedTasksTableColumns = _.union(
-      _.first(taskColumns, 2),
-      [
-        {label: 'Running duration',
-          map: 'duration',
-          formatFunction: function (duration) {
-            return moment(moment().subtract(duration)).fromNow(true);
-          }
-        }
-      ],
-      _.last(taskColumns, taskColumns.length - 2)
-    );
+    $scope.completedTasksTableColumns = completedTaskColumns;
+
+    function addColumn(idxPosition, currentColumns, newColumn) {
+      return _.union(
+        _.first(currentColumns, idxPosition),
+        [ newColumn ],
+        _.last(currentColumns, currentColumns.length - idxPosition));
+    }
 
     $scope.jobDashboardURL = '';
 


Mime
View raw message