From 39636be7b018b9121696ce7bdc462ab2c3c8185d Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 11 Jan 2013 17:11:28 +0100 Subject: o Creating bin/web for running the web application. --- .../webapp/apps/jenkinsApp/JenkinsResources.js | 25 +++++++++ .../resources/webapp/apps/jenkinsApp/build.html | 43 +++++++++++++++ .../resources/webapp/apps/jenkinsApp/jenkinsApp.js | 57 +++++++++++++++++++ src/main/resources/webapp/apps/jenkinsApp/job.html | 61 +++++++++++++++++++++ .../webapp/apps/jenkinsApp/server-list.html | 32 +++++++++++ .../resources/webapp/apps/jenkinsApp/server.html | 64 ++++++++++++++++++++++ 6 files changed, 282 insertions(+) create mode 100644 src/main/resources/webapp/apps/jenkinsApp/JenkinsResources.js create mode 100644 src/main/resources/webapp/apps/jenkinsApp/build.html create mode 100644 src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js create mode 100755 src/main/resources/webapp/apps/jenkinsApp/job.html create mode 100644 src/main/resources/webapp/apps/jenkinsApp/server-list.html create mode 100644 src/main/resources/webapp/apps/jenkinsApp/server.html (limited to 'src/main/resources/webapp/apps/jenkinsApp') diff --git a/src/main/resources/webapp/apps/jenkinsApp/JenkinsResources.js b/src/main/resources/webapp/apps/jenkinsApp/JenkinsResources.js new file mode 100644 index 0000000..89f3139 --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/JenkinsResources.js @@ -0,0 +1,25 @@ +'use strict'; + +function JenkinsServer($resource) { + return $resource('/resource/jenkins/server/:uuid', {uuid: '@uuid'}); +} + +angular. + module('jenkinsServer', ['ngResource']). + factory('JenkinsServer', JenkinsServer); + +function JenkinsJob($resource) { + return $resource('/resource/jenkins/job/:uuid', {uuid: '@uuid'}); +} + +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/resources/webapp/apps/jenkinsApp/build.html b/src/main/resources/webapp/apps/jenkinsApp/build.html new file mode 100644 index 0000000..7239c90 --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/build.html @@ -0,0 +1,43 @@ +
+ + + + + + + +

Overview

+ + + + + + + + + + + + + + + +
Timestamp{{details.build.timestamp | date:'medium'}}
Number{{details.build.number}}
Duration{{details.build.duration / 1000 | number:0}}s
+ +

Users

+ + + + + + +
{{user.uuid}}
+ +
diff --git a/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js new file mode 100644 index 0000000..e42c67b --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/jenkinsApp.js @@ -0,0 +1,57 @@ +'use strict'; + +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}); +}); + +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; + + JenkinsServer.get({uuid: 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); }; +} + +function JobCtrl($scope, $location, $routeParams, JenkinsJob, JenkinsBuild, PagingTableService) { + var jobUuid = $routeParams.uuid; + + 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 () { $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); }; +} diff --git a/src/main/resources/webapp/apps/jenkinsApp/job.html b/src/main/resources/webapp/apps/jenkinsApp/job.html new file mode 100755 index 0000000..8942ab7 --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/job.html @@ -0,0 +1,61 @@ +
+ + + + + + + +

Overview

+ + + + + + + + + + + + +
URL{{details.job.displayName}}
Build count{{details.buildCount}}
+ +

Recent Builds

+ + + + + + + + + + + + + + + + + + + + +
BuildResult
{{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 new file mode 100644 index 0000000..9e297e6 --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/server-list.html @@ -0,0 +1,32 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
URLEnabled
{{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 new file mode 100644 index 0000000..7fbd9f5 --- /dev/null +++ b/src/main/resources/webapp/apps/jenkinsApp/server.html @@ -0,0 +1,64 @@ +
+ + + + + + + + +

Overview

+ + + + + + + + + + + + + + + +
URL{{server.url}}
Enabled{{server.enabled}}
Stats{{server.jobCount}} jobs, {{server.buildCount}} builds
+ +

Recent Jobs

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