aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/apps
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-19 23:42:12 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-19 23:42:12 +0100
commit79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0 (patch)
tree815da28b8238bbe3bf44ef126fb79c0ffaf41de6 /src/main/webapp/apps
parent4abc880c4b9ce6888acab85c815514f3dd195fa4 (diff)
downloadesper-testing-79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0.tar.gz
esper-testing-79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0.tar.bz2
esper-testing-79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0.tar.xz
esper-testing-79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0.zip
o Adding a basic web app.
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>