summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam@sotk.co.uk>2015-09-26 11:12:57 +0100
committerAdam Coldrick <adam@sotk.co.uk>2015-09-28 20:20:09 +0100
commit05522667a1f80877af2d251369dcea72685e5522 (patch)
tree6652416e28ffb01072d0011fbbe01ff26a3b1479
parent947afca4799734e5951e6764794c96fb527a7fb8 (diff)
downloadciat-ui-05522667a1f80877af2d251369dcea72685e5522.tar.gz
Process the data a bit
-rw-r--r--index.html6
-rw-r--r--js/main.js13
2 files changed, 15 insertions, 4 deletions
diff --git a/index.html b/index.html
index 86fc67e..69b6044 100644
--- a/index.html
+++ b/index.html
@@ -10,9 +10,9 @@
<h1><em>Baserock</em> <span>|</span> CIAT</h1>
<div class="visualisation" ng-controller="VisualisationController">
- <div class="box pass"
- ng-repeat="(name, data) in builders.data">
- {{name}}
+ <div class="box"
+ ng-repeat="step in steps">
+ {{step.name}}
</div>
</div>
</body>
diff --git a/js/main.js b/js/main.js
index fb1486e..4295b8c 100644
--- a/js/main.js
+++ b/js/main.js
@@ -8,6 +8,17 @@ app.config(['$httpProvider', function($httpProvider) {
app.controller('VisualisationController', ['$scope', '$http',
function($scope, $http) {
- $scope.builders = $http.get('http://ciat.baserock.org:8010/json/builders');
+ $scope.steps = [];
+ $http.get('http://ciat.baserock.org:8010/json/builders')
+ .then(function(builders) {
+ angular.forEach(builders.data, function(value, key) {
+ var step = {
+ name: key,
+ last_build: value.cachedBuilds[value.cachedBuilds.length - 1],
+ data: value
+ }
+ $scope.steps.push(step);
+ });
+ });
}
]);