From 5ec81d9e77fcb56ddf5953989e23b6cafe4772a3 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 29 Dec 2012 18:59:32 +0100 Subject: o Adding build view for jenkins app. --- src/main/webapp/apps/jenkinsApp/jenkinsApp.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/main/webapp/apps/jenkinsApp/jenkinsApp.js') diff --git a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js index 19d107d..1cd2d2a 100644 --- a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js +++ b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js @@ -4,7 +4,8 @@ var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'j $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('/job/:uuid', {controller: JobCtrl, templateUrl: '/apps/jenkinsApp/job.html?noCache=' + noCache}). + when('/build/:uuid', {controller: BuildCtrl, templateUrl: '/apps/jenkinsApp/build.html?noCache=' + noCache}); }); function ServerListCtrl($scope, $location, JenkinsServer) { @@ -32,12 +33,25 @@ function ServerCtrl($scope, $location, $routeParams, JenkinsServer, JenkinsJob, function JobCtrl($scope, $location, $routeParams, JenkinsJob, JenkinsBuild, PagingTableService) { var jobUuid = $routeParams.uuid; - JenkinsJob.get({uuid: jobUuid}, function (job) { - $scope.job = job; + JenkinsJob.get({uuid: jobUuid}, function (details) { + $scope.details = details; }); $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsBuild, {job: jobUuid})); $scope.showServers = function () { $location.path('/'); }; - $scope.showServer = function (uuid) { $location.path('/server/' + $scope.job.server); }; + $scope.showServer = function () { $location.path('/server/' + $scope.job.server); }; + $scope.showBuild = function (uuid) { $location.path('/build/' + uuid); }; +} + +function BuildCtrl($scope, $location, $routeParams, JenkinsBuild) { + var buildUuid = $routeParams.uuid; + + JenkinsBuild.get({uuid: 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); }; } -- cgit v1.2.3