From 010c5d2a723d5f284f3861992909f0366dcf0d1e Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Tue, 29 Sep 2015 00:06:40 +0100 Subject: Initial builder detail page --- js/main.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'js/main.js') 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 + }; + }); + } +); -- cgit v1.2.1