diff options
author | Adam Coldrick <adam@sotk.co.uk> | 2015-09-29 00:06:40 +0100 |
---|---|---|
committer | Adam Coldrick <adam@sotk.co.uk> | 2015-09-29 00:41:38 +0100 |
commit | 010c5d2a723d5f284f3861992909f0366dcf0d1e (patch) | |
tree | 6c70bd3f8755b0c8304c890519e72a415ed6bc4d | |
parent | 80851e285db6574cc77e135196487431b95515c8 (diff) | |
download | ciat-ui-010c5d2a723d5f284f3861992909f0366dcf0d1e.tar.gz |
Initial builder detail page
-rw-r--r-- | js/main.js | 19 | ||||
-rw-r--r-- | partials/builder_detail.html | 30 | ||||
-rw-r--r-- | style.css | 4 |
3 files changed, 50 insertions, 3 deletions
@@ -1,3 +1,4 @@ +var apiBase = 'http://ciat.baserock.org:8010/json'; var app = angular.module('ciat', ['ngRoute']); app.config(['$httpProvider', function($httpProvider) { @@ -34,7 +35,7 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) function load() { $scope.steps = []; - $http.get('http://ciat.baserock.org:8010/json/builders') + $http.get(apiBase + '/builders') .then(function(builders) { angular.forEach(builders.data, function(value, key) { var lastBuildID; @@ -44,8 +45,8 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) lastBuildID = value.cachedBuilds[value.cachedBuilds.length - 1]; } - var buildsPath = 'http://ciat.baserock.org:8010/json/builders/' + - key + '/builds/' + lastBuildID; + var buildsPath = apiBase + '/builders/' + key + + '/builds/' + lastBuildID; $http.get(buildsPath).then(function(response) { var details = { success: checkInArray(response.data.text, 'successful'), @@ -96,3 +97,15 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) }); } ); + + +app.controller('BuilderDetailController', + function($scope, $http, $routeParams) { + $http.get(apiBase + '/builders/' + $routeParams.name).then(function(builder) { + $scope.builder = { + name: $routeParams.name, + data: builder.data + }; + }); + } +); diff --git a/partials/builder_detail.html b/partials/builder_detail.html new file mode 100644 index 0000000..8eae351 --- /dev/null +++ b/partials/builder_detail.html @@ -0,0 +1,30 @@ +<div class="container"> + <div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title"><strong>{{builder.name}}</strong></h3> + </div> + <div class="panel-body"> + <p><strong>State:</strong> {{builder.data.state}}</p> + <p><strong>Recent Builds:</strong></p> + <table class="table table-striped table-hover"> + <thead><strong> + <td>Time</td> + <td>Revision</td> + <td>Result</td> + <td>Number</td> + </strong> + </thead> + <tbody> + <!-- TODO: Load all builds into $scope.builds rather than + using builder.data.cachedBuilds --> + <tr ng-repeat="build in builder.data.cachedBuilds"> + <td>build.time</td> + <td>build.revision</td> + <td>build.result</td> + <td>{{build}}</td> + </tr> + </tbody> + </table> + </div> + </div> +</div> @@ -96,3 +96,7 @@ h1>span { .content { height: 85%; } + +.container { + color: #111; +} |