summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam@sotk.co.uk>2015-09-29 00:06:40 +0100
committerAdam Coldrick <adam@sotk.co.uk>2015-09-29 00:41:38 +0100
commit010c5d2a723d5f284f3861992909f0366dcf0d1e (patch)
tree6c70bd3f8755b0c8304c890519e72a415ed6bc4d
parent80851e285db6574cc77e135196487431b95515c8 (diff)
downloadciat-ui-010c5d2a723d5f284f3861992909f0366dcf0d1e.tar.gz
Initial builder detail page
-rw-r--r--js/main.js19
-rw-r--r--partials/builder_detail.html30
-rw-r--r--style.css4
3 files changed, 50 insertions, 3 deletions
diff --git a/js/main.js b/js/main.js
index 2ed73db..e7d2090 100644
--- a/js/main.js
+++ b/js/main.js
@@ -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>
diff --git a/style.css b/style.css
index c7a0a2e..5079583 100644
--- a/style.css
+++ b/style.css
@@ -96,3 +96,7 @@ h1>span {
.content {
height: 85%;
}
+
+.container {
+ color: #111;
+}