diff options
author | Adam Coldrick <adam@sotk.co.uk> | 2015-09-26 11:12:57 +0100 |
---|---|---|
committer | Adam Coldrick <adam@sotk.co.uk> | 2015-09-28 20:20:09 +0100 |
commit | 05522667a1f80877af2d251369dcea72685e5522 (patch) | |
tree | 6652416e28ffb01072d0011fbbe01ff26a3b1479 | |
parent | 947afca4799734e5951e6764794c96fb527a7fb8 (diff) | |
download | ciat-ui-05522667a1f80877af2d251369dcea72685e5522.tar.gz |
Process the data a bit
-rw-r--r-- | index.html | 6 | ||||
-rw-r--r-- | js/main.js | 13 |
2 files changed, 15 insertions, 4 deletions
@@ -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> @@ -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); + }); + }); } ]); |