aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jco...@apache.org
Subject aurora git commit: Make it possible to link directly to individual tabs on the job page.
Date Thu, 03 Sep 2015 21:05:48 GMT
Repository: aurora
Updated Branches:
  refs/heads/master f3cbc399e -> 9c0b1b239


Make it possible to link directly to individual tabs on the job page.

Bugs closed: AURORA-696

Reviewed at https://reviews.apache.org/r/38106/


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

Branch: refs/heads/master
Commit: 9c0b1b239510045869d9f9a93847beb705ae5f12
Parents: f3cbc39
Author: Joshua Cohen <jcohen@apache.org>
Authored: Thu Sep 3 16:05:21 2015 -0500
Committer: Joshua Cohen <jcohen@apache.org>
Committed: Thu Sep 3 16:05:21 2015 -0500

----------------------------------------------------------------------
 src/main/resources/scheduler/assets/job.html     | 19 +++++++++++++++----
 src/main/resources/scheduler/assets/js/app.js    |  2 +-
 .../resources/scheduler/assets/js/controllers.js | 14 ++++++++++++++
 3 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/9c0b1b23/src/main/resources/scheduler/assets/job.html
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/job.html b/src/main/resources/scheduler/assets/job.html
index bfe51ab..a8be604 100644
--- a/src/main/resources/scheduler/assets/job.html
+++ b/src/main/resources/scheduler/assets/job.html
@@ -79,7 +79,11 @@
     </div>
 
     <tabset ng-if="tasksReady" justified='true'>
-      <tab heading='Active tasks ({{activeTasks.length}})' title='All Active tasks for
this job.'>
+      <tab
+          heading='Active tasks ({{activeTasks.length}})'
+          title='All Active tasks for this job.'
+          active='isActive'
+          ng-click='switchTab("active")'>
         <div class='task-tab'>
           <div class='group-summary'>
             <group-summary groups='groupSummary'></group-summary>
@@ -94,8 +98,11 @@
         </div>
       </tab>
 
-      <tab heading='Completed tasks ({{completedTasks.length}})'
-           title='All completed tasks for this job.'>
+      <tab
+          heading='Completed tasks ({{completedTasks.length}})'
+          title='All completed tasks for this job.'
+          active='isCompleted'
+          ng-click='switchTab("completed")'>
         <div class='task-tab container-fluid completed-tasks-tab'>
           <smart-table config='completedTasksTableConfig'
                        columns='completedTasksTableColumns'
@@ -105,7 +112,11 @@
         </div>
       </tab>
 
-      <tab heading='All tasks' title='Both active and completed tasks for this job.'>
+      <tab
+          heading='All tasks'
+          title='Both active and completed tasks for this job.'
+          active='isAll'
+          ng-click='switchTab("all")'>
         <div class='task-tab'>
           <div class='group-summary'>
             <group-summary groups='groupSummary'></group-summary>

http://git-wip-us.apache.org/repos/asf/aurora/blob/9c0b1b23/src/main/resources/scheduler/assets/js/app.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/app.js b/src/main/resources/scheduler/assets/js/app.js
index 310aa35..85baaf8 100644
--- a/src/main/resources/scheduler/assets/js/app.js
+++ b/src/main/resources/scheduler/assets/js/app.js
@@ -30,7 +30,7 @@ var auroraUI;
       {templateUrl: '/assets/role.html', controller: 'JobSummaryController'});
 
     $routeProvider.when('/scheduler/:role/:environment/:job',
-      {templateUrl: '/assets/job.html', controller: 'JobController'});
+      {templateUrl: '/assets/job.html', controller: 'JobController', reloadOnSearch: false});
 
     $routeProvider.when('/scheduler/:role/:environment/:job/:instance',
       {templateUrl: '/assets/instance.html', controller: 'JobInstanceController'});

http://git-wip-us.apache.org/repos/asf/aurora/blob/9c0b1b23/src/main/resources/scheduler/assets/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/controllers.js b/src/main/resources/scheduler/assets/js/controllers.js
index 9892019..4acab10 100644
--- a/src/main/resources/scheduler/assets/js/controllers.js
+++ b/src/main/resources/scheduler/assets/js/controllers.js
@@ -349,6 +349,7 @@
       $routeParams,
       $timeout,
       $q,
+      $location,
       auroraClient,
       taskUtil,
       updateUtil,
@@ -359,6 +360,14 @@
     $scope.showTaskInfoLink = false;
     $scope.jobDashboardUrl = '';
 
+    function setTabState(tab) {
+      $scope.isActive = tab === 'active';
+      $scope.isCompleted = tab === 'completed';
+      $scope.isAll = tab === 'all';
+    }
+
+    setTabState($location.search().tab || 'active');
+
     $scope.toggleTaskInfoLinkVisibility = function () {
       $scope.showTaskInfoLink = !$scope.showTaskInfoLink;
 
@@ -377,6 +386,11 @@
         jobTasksService.completedTaskColumns;
     };
 
+    $scope.switchTab = function (tab) {
+      $location.search('tab', tab);
+      setTabState(tab);
+    };
+
     jobTasksService.getTasksForJob($scope);
 
     function buildGroupSummary(response) {


Mime
View raw message