aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/apps/jenkinsApp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/apps/jenkinsApp')
-rw-r--r--src/main/webapp/apps/jenkinsApp/JenkinsResources.js8
-rw-r--r--src/main/webapp/apps/jenkinsApp/jenkinsApp.js41
-rw-r--r--src/main/webapp/apps/jenkinsApp/job.html59
-rw-r--r--src/main/webapp/apps/jenkinsApp/server-list.html52
-rw-r--r--src/main/webapp/apps/jenkinsApp/server.html1
5 files changed, 115 insertions, 46 deletions
diff --git a/src/main/webapp/apps/jenkinsApp/JenkinsResources.js b/src/main/webapp/apps/jenkinsApp/JenkinsResources.js
index 0026932..89f3139 100644
--- a/src/main/webapp/apps/jenkinsApp/JenkinsResources.js
+++ b/src/main/webapp/apps/jenkinsApp/JenkinsResources.js
@@ -15,3 +15,11 @@ function JenkinsJob($resource) {
angular.
module('jenkinsJob', ['ngResource']).
factory('JenkinsJob', JenkinsJob);
+
+function JenkinsBuild($resource) {
+ return $resource('/resource/jenkins/build/:uuid', {uuid: '@uuid'});
+}
+
+angular.
+ module('jenkinsBuild', ['ngResource']).
+ factory('JenkinsBuild', JenkinsBuild);
diff --git a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
index e51c9f3..19d107d 100644
--- a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
+++ b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
@@ -1,14 +1,10 @@
'use strict';
-var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'pagingTableService']).config(function ($routeProvider) {
+var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServer', 'jenkinsJob', 'jenkinsBuild', 'pagingTableService']).config(function ($routeProvider) {
$routeProvider.
- when('/', {controller: ServerListCtrl, templateUrl: '/apps/jenkinsApp/server-list.html?noCache=' + noCache});
- $routeProvider.
- when('/server/:uuid', {controller: ServerCtrl, templateUrl: '/apps/jenkinsApp/server.html?noCache=' + noCache});
-// $routeProvider.otherwise({ redirectTo: '/' });
-
- // This fucks shit up
-// $locationProvider.html5Mode(true);
+ 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});
});
function ServerListCtrl($scope, $location, JenkinsServer) {
@@ -16,13 +12,8 @@ function ServerListCtrl($scope, $location, JenkinsServer) {
$scope.servers = servers;
});
- $scope.showServers = function () {
- $location.path('/');
- };
-
- $scope.showServer = function (uuid) {
- $location.path('/server/' + uuid);
- };
+ $scope.showServers = function () { $location.path('/'); };
+ $scope.showServer = function (uuid) { $location.path('/server/' + uuid); };
}
function ServerCtrl($scope, $location, $routeParams, JenkinsServer, JenkinsJob, PagingTableService) {
@@ -34,11 +25,19 @@ function ServerCtrl($scope, $location, $routeParams, JenkinsServer, JenkinsJob,
$scope.jobs = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsJob, {server: serverUuid}));
- $scope.showServers = function () {
- $location.path('/');
- };
+ $scope.showServers = function () { $location.path('/'); };
+ $scope.showJob = function (uuid) { $location.path('/job/' + uuid); };
+}
+
+function JobCtrl($scope, $location, $routeParams, JenkinsJob, JenkinsBuild, PagingTableService) {
+ var jobUuid = $routeParams.uuid;
+
+ JenkinsJob.get({uuid: jobUuid}, function (job) {
+ $scope.job = job;
+ });
+
+ $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(JenkinsBuild, {job: jobUuid}));
- $scope.showServer = function (uuid) {
- $location.path('/server/' + uuid);
- };
+ $scope.showServers = function () { $location.path('/'); };
+ $scope.showServer = function (uuid) { $location.path('/server/' + $scope.job.server); };
}
diff --git a/src/main/webapp/apps/jenkinsApp/job.html b/src/main/webapp/apps/jenkinsApp/job.html
new file mode 100644
index 0000000..5113d2e
--- /dev/null
+++ b/src/main/webapp/apps/jenkinsApp/job.html
@@ -0,0 +1,59 @@
+<div class="container">
+
+ <div class="page-header">
+ <h1>Jenkins Job</h1>
+ </div>
+
+ <ul class="breadcrumb">
+ <li><a ng-click="showServers()">All Servers</a> <span class="divider">/</span></li>
+ <li><a ng-click="showServer()">Servers</a> <span class="divider">/</span></li>
+ <li class="active">Job</li>
+ </ul>
+
+ <h3>Overview</h3>
+
+ <table class="table">
+ <tbody>
+ <tr>
+ <th>URL</th>
+ <td><a href="{{job.displayName}}">{{job.displayName}}</a></td>
+ </tr>
+ <tr>
+ <th>Build count</th>
+ <td>{{job.buildCount}}</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>Recent Builds</h3>
+ <table class="table">
+ <thead>
+ <tr>
+ <th>Build</th>
+ <th>Result</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="build in builds.rows" class="{{{true: 'success', false: 'error'}[build.success]}}">
+ <td>{{build.createdDate | date:'medium'}}</td>
+ <td>{{build.result}}</td>
+ <td><a class="btn" ng-click="showBuild(build.uuid)"><i class="icon-chevron-right"></i></a></td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="3">
+ <ul class="pager">
+ <li class="previous" ng-class="{disabled: builds.startIndex == 0}">
+ <a ng-click="builds.prev()">&larr; Older</a>
+ </li>
+ <li class="next">
+ <a ng-click="builds.next()">Newer &rarr;</a>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+</div>
diff --git a/src/main/webapp/apps/jenkinsApp/server-list.html b/src/main/webapp/apps/jenkinsApp/server-list.html
index f335c1f..e488186 100644
--- a/src/main/webapp/apps/jenkinsApp/server-list.html
+++ b/src/main/webapp/apps/jenkinsApp/server-list.html
@@ -1,27 +1,29 @@
-<div class="page-header">
- <h1>Jenkins Servers</h1>
-</div>
+<div class="container">
+ <div class="page-header">
+ <h1>Jenkins Servers</h1>
+ </div>
-<ul class="breadcrumb">
- <li class="active">All Servers</li>
-</ul>
+ <ul class="breadcrumb">
+ <li class="active">All Servers</li>
+ </ul>
-<table class="table table-condensed">
- <thead>
- <tr>
- <th class="header">URL</th>
- <th class="header">Enabled</th>
- <th class=""></th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="server in servers">
- <td>{{server.url}}</td>
- <td>{{server.enabled}}</td>
- <td>
- <a href="{{server.url}}">Visit</a>
- <a ng-click="showServer(server.uuid)">Details</a>
- </td>
- </tr>
- </tbody>
-</table>
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>URL</th>
+ <th>Enabled</th>
+ <th></th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="server in servers">
+ <td>{{server.url}}</td>
+ <td>{{server.enabled}}</td>
+ <td><a href="{{server.url}}">Visit</a></td>
+ <td><a class="btn" ng-click="showServer(server.uuid)"><i class="icon-chevron-right"></i></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
diff --git a/src/main/webapp/apps/jenkinsApp/server.html b/src/main/webapp/apps/jenkinsApp/server.html
index 8a784e8..03be57e 100644
--- a/src/main/webapp/apps/jenkinsApp/server.html
+++ b/src/main/webapp/apps/jenkinsApp/server.html
@@ -39,6 +39,7 @@
<td>{{job.createdDate | date:'medium'}}</td>
<td>{{job.displayName}}</td>
<td>{{job.uuid}}</td>
+ <td><a class="btn" ng-click="showJob(job.uuid)"><i class="icon-chevron-right"></i></a></td>
</tr>
</tbody>
<tfoot>