From fd953370ba0daea03c5de58aac30e097f86826c6 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 19 Jan 2013 10:20:43 +0100 Subject: o Making sure every resource that supports paging has a default ordering. o Fixing mis-mapped JenkinsJob. o Better navigation in the Jenkins app, links are now proper links. --- .../resources/webapp/apps/jenkinsApp/build.html | 6 ++-- .../resources/webapp/apps/jenkinsApp/jenkinsApp.js | 39 ++++++++-------------- src/main/resources/webapp/apps/jenkinsApp/job.html | 8 ++--- .../webapp/apps/jenkinsApp/server-list.html | 2 +- .../resources/webapp/apps/jenkinsApp/server.html | 14 +++----- 5 files changed, 26 insertions(+), 43 deletions(-) mode change 100644 => 100755 src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js mode change 100644 => 100755 src/main/resources/webapp/apps/jenkinsApp/server-list.html mode change 100644 => 100755 src/main/resources/webapp/apps/jenkinsApp/server.html (limited to 'src/main/resources') diff --git a/src/main/resources/webapp/apps/jenkinsApp/build.html b/src/main/resources/webapp/apps/jenkinsApp/build.html index 7239c90..13e3b8b 100755 --- a/src/main/resources/webapp/apps/jenkinsApp/build.html +++ b/src/main/resources/webapp/apps/jenkinsApp/build.html @@ -7,9 +7,9 @@ diff --git a/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js old mode 100644 new mode 100755 index e42c67b..68344cd --- a/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js +++ b/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js @@ -3,55 +3,44 @@ var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'jenkinsBuild', 'core.directives', 'pagingTableService']).config(function ($routeProvider) { $routeProvider. when('/', {controller: ServerListCtrl, templateUrl: '/apps/jenkinsApp/server-list.html?noCache=' + noCache}). - when('/server/:uuid', {controller: ServerCtrl, templateUrl: '/apps/jenkinsApp/server.html?noCache=' + noCache}). - when('/job/:uuid', {controller: JobCtrl, templateUrl: '/apps/jenkinsApp/job.html?noCache=' + noCache}). - when('/build/:uuid', {controller: BuildCtrl, templateUrl: '/apps/jenkinsApp/build.html?noCache=' + noCache}); + when('/server/:serverUuid', {controller: ServerCtrl, templateUrl: '/apps/jenkinsApp/server.html?noCache=' + noCache}). + when('/server/:serverUuid/job/:jobUuid', {controller: JobCtrl, templateUrl: '/apps/jenkinsApp/job.html?noCache=' + noCache}). + when('/server/:serverUuid/job/:jobUuid/build/:buildUuid', {controller: BuildCtrl, templateUrl: '/apps/jenkinsApp/build.html?noCache=' + noCache}); }); function ServerListCtrl($scope, $location, JenkinsServer) { JenkinsServer.query(function (servers) { $scope.servers = servers; }); - - $scope.showServers = function () { $location.path('/'); }; - $scope.showServer = function (uuid) { $location.path('/server/' + uuid); }; } function ServerCtrl($scope, $location, $routeParams, JenkinsServer, JenkinsJob, PagingTableService) { - var serverUuid = $routeParams.uuid; + $scope.serverUuid = $routeParams.serverUuid; - JenkinsServer.get({uuid: serverUuid}, function (server) { + JenkinsServer.get({uuid: $scope.serverUuid}, function (server) { $scope.server = server; }); - $scope.jobs = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsJob, {server: serverUuid})); - - $scope.showServers = function () { $location.path('/'); }; - $scope.showJob = function (uuid) { $location.path('/job/' + uuid); }; + $scope.jobs = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsJob, {server: $scope.serverUuid})); } function JobCtrl($scope, $location, $routeParams, JenkinsJob, JenkinsBuild, PagingTableService) { - var jobUuid = $routeParams.uuid; + $scope.serverUuid = $routeParams.serverUuid; + $scope.jobUuid = $routeParams.jobUuid; - JenkinsJob.get({uuid: jobUuid}, function (details) { + JenkinsJob.get({uuid: $scope.jobUuid}, function (details) { $scope.details = details; }); - $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsBuild, {job: jobUuid})); - - $scope.showServers = function () { $location.path('/'); }; - $scope.showServer = function () { $location.path('/server/' + $scope.job.server); }; - $scope.showBuild = function (uuid) { $location.path('/build/' + uuid); }; + $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsBuild, {job: $scope.jobUuid, orderBy: "timestamp-"})); } function BuildCtrl($scope, $location, $routeParams, JenkinsBuild) { - var buildUuid = $routeParams.uuid; + $scope.serverUuid = $routeParams.serverUuid; + $scope.jobUuid = $routeParams.jobUuid; + $scope.buildUuid = $routeParams.buildUuid; - JenkinsBuild.get({uuid: buildUuid}, function (details) { + JenkinsBuild.get({uuid: $scope.buildUuid}, function (details) { $scope.details = details; }); - - $scope.showServers = function () { $location.path('/'); }; - $scope.showServer = function (uuid) { $location.path('/server/' + $scope.server.uuid); }; - $scope.showJob = function (uuid) { $location.path('/job/' + $scope.build.job); }; } diff --git a/src/main/resources/webapp/apps/jenkinsApp/job.html b/src/main/resources/webapp/apps/jenkinsApp/job.html index 8942ab7..4f21fad 100755 --- a/src/main/resources/webapp/apps/jenkinsApp/job.html +++ b/src/main/resources/webapp/apps/jenkinsApp/job.html @@ -7,8 +7,8 @@ @@ -18,7 +18,7 @@ URL - {{details.job.displayName}} + {{details.job.displayName}} Build count @@ -40,7 +40,7 @@ {{build.timestamp | date:'medium'}} {{build.result}} - + diff --git a/src/main/resources/webapp/apps/jenkinsApp/server-list.html b/src/main/resources/webapp/apps/jenkinsApp/server-list.html old mode 100644 new mode 100755 index 9e297e6..93e5e9e --- a/src/main/resources/webapp/apps/jenkinsApp/server-list.html +++ b/src/main/resources/webapp/apps/jenkinsApp/server-list.html @@ -24,7 +24,7 @@ {{server.url}} {{server.enabled}} Visit - + diff --git a/src/main/resources/webapp/apps/jenkinsApp/server.html b/src/main/resources/webapp/apps/jenkinsApp/server.html old mode 100644 new mode 100755 index 7fbd9f5..fb821d3 --- a/src/main/resources/webapp/apps/jenkinsApp/server.html +++ b/src/main/resources/webapp/apps/jenkinsApp/server.html @@ -8,7 +8,7 @@ @@ -25,24 +25,18 @@ Stats - {{server.jobCount}} jobs, {{server.buildCount}} builds + {{server.jobCount}} jobs

Recent Jobs

- - - - - - - - + + -- cgit v1.2.3
Job
{{job.createdDate | date:'medium'}} {{job.displayName}}{{job.uuid}}{{job.createdDate | date:'medium'}}