summaryrefslogtreecommitdiff
path: root/js/main.js
blob: 4295b8c512995c4c73477f3ef04b6c1a44079435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var app = angular.module('ciat', []);

app.config(['$httpProvider', function($httpProvider) {
        $httpProvider.defaults.useXDomain = true;
        delete $httpProvider.defaults.headers.common['X-Requested-With'];
    }
]);

app.controller('VisualisationController', ['$scope', '$http',
    function($scope, $http) {
        $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);
                });
            });
    }
]);