aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/apps
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/apps')
-rw-r--r--src/main/webapp/apps/jenkinsApp/JenkinsServerService.js9
-rw-r--r--src/main/webapp/apps/jenkinsApp/jenkinsApp.js29
-rw-r--r--src/main/webapp/apps/jenkinsApp/server-list.html22
-rw-r--r--src/main/webapp/apps/jenkinsApp/server.html20
4 files changed, 80 insertions, 0 deletions
diff --git a/src/main/webapp/apps/jenkinsApp/JenkinsServerService.js b/src/main/webapp/apps/jenkinsApp/JenkinsServerService.js
new file mode 100644
index 0000000..054a9bb
--- /dev/null
+++ b/src/main/webapp/apps/jenkinsApp/JenkinsServerService.js
@@ -0,0 +1,9 @@
+"use strict";
+
+function JenkinsServerService($resource) {
+ return $resource('/resource/jenkins/server/:uuid', {uuid: '@uuid'});
+}
+
+angular.
+ module('jenkinsServerService', ['ngResource']).
+ factory('JenkinsServerService', JenkinsServerService);
diff --git a/src/main/webapp/apps/jenkinsApp/jenkinsApp.js b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
new file mode 100644
index 0000000..5370496
--- /dev/null
+++ b/src/main/webapp/apps/jenkinsApp/jenkinsApp.js
@@ -0,0 +1,29 @@
+'use strict';
+
+var jenkinsApp = angular.module('jenkinsApp', ['jenkinsServerService']).config(function ($routeProvider, $locationProvider) {
+ $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);
+});
+
+function ServerListCtrl($scope, $route, $routeParams, $location, JenkinsServerService) {
+ JenkinsServerService.query(function (servers) {
+ $scope.servers = servers;
+ });
+
+ $scope.showServer = function (uuid) {
+ $location.path('/server/' + uuid);
+ };
+}
+
+function ServerCtrl($scope, $routeParams, JenkinsServerService) {
+ window.x = $routeParams;
+ JenkinsServerService.get({uuid: $routeParams.uuid}, function (server) {
+ $scope.server = server;
+ });
+}
diff --git a/src/main/webapp/apps/jenkinsApp/server-list.html b/src/main/webapp/apps/jenkinsApp/server-list.html
new file mode 100644
index 0000000..0ca65d6
--- /dev/null
+++ b/src/main/webapp/apps/jenkinsApp/server-list.html
@@ -0,0 +1,22 @@
+<div class="page-header">
+ <h1>Jenkins Servers</h1>
+</div>
+<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>
diff --git a/src/main/webapp/apps/jenkinsApp/server.html b/src/main/webapp/apps/jenkinsApp/server.html
new file mode 100644
index 0000000..e15f43e
--- /dev/null
+++ b/src/main/webapp/apps/jenkinsApp/server.html
@@ -0,0 +1,20 @@
+<div class="page-header">
+ <h1>Jenkins Server</h1>
+</div>
+
+<table class="table">
+ <tbody>
+ <tr>
+ <th>URL</th>
+ <td>{{server.url}}</td>
+ </tr>
+ <tr>
+ <th>Enabled</th>
+ <td>{{server.enabled}}</td>
+ </tr>
+ <tr>
+ <th>Visit</th>
+ <td>{{server.visit}}</td>
+ </tr>
+ </tbody>
+</table>