From 79c6c1d042fdad06294f4db57c5b8c91b6a0e5d0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 19 Dec 2012 23:42:12 +0100 Subject: o Adding a basic web app. --- .../webapp/apps/jenkinsApp/JenkinsServerService.js | 9 +++++++ src/main/webapp/apps/jenkinsApp/jenkinsApp.js | 29 ++++++++++++++++++++++ src/main/webapp/apps/jenkinsApp/server-list.html | 22 ++++++++++++++++ src/main/webapp/apps/jenkinsApp/server.html | 20 +++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 src/main/webapp/apps/jenkinsApp/JenkinsServerService.js create mode 100644 src/main/webapp/apps/jenkinsApp/jenkinsApp.js create mode 100644 src/main/webapp/apps/jenkinsApp/server-list.html create mode 100644 src/main/webapp/apps/jenkinsApp/server.html (limited to 'src/main/webapp/apps/jenkinsApp') 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 @@ + + + + + + + + + + + + + + + + +
URLEnabled
{{server.url}}{{server.enabled}} + Visit + Details +
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 @@ + + + + + + + + + + + + + + + + + +
URL{{server.url}}
Enabled{{server.enabled}}
Visit{{server.visit}}
-- cgit v1.2.3