diff options
-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); + }); + }); } ]); |