From 5cf363c212191678fa7e7a22c3efae81a35390cf Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 2 Oct 2015 16:48:16 +0200 Subject: Add currentBuild information in details dialog --- js/main.js | 10 +++++++++- partials/visualisation.html | 14 ++++++++++++++ style.css | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 78ac7b0..53c564f 100644 --- a/js/main.js +++ b/js/main.js @@ -48,6 +48,9 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) var state = value.state; var latestBuildNumber = value.cachedBuilds.length - 1; + if (state === 'building') { + latestBuildNumber = value.currentBuilds[0]; + } var latestBuildsPath = apiBase + '/builders/' + key + '/builds/' + latestBuildNumber; $http.get(latestBuildsPath).then(function(estimationResponse) { @@ -82,6 +85,7 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) $scope.integrations.push({ name: key, lastBuild: details, + currentBuild: estimationResponse.data, data: value }); } @@ -101,16 +105,17 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) $scope.builds.push({ name: key, lastBuild: details, + currentBuild: estimationResponse.data, data: value, progress: progress, style: progressStyle - }); } else if(key.indexOf("Deploy") > -1) { $scope.deploys.push({ name: key, lastBuild: details, + currentBuild: estimationResponse.data, data: value }); } @@ -118,6 +123,7 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) $scope.tests.push({ name: key, lastBuild: details, + currentBuild: estimationResponse.data, data: value }); } @@ -125,6 +131,7 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) $scope.publishings.push({ name: key, lastBuild: details, + currentBuild: estimationResponse.data, data: value }); } @@ -157,6 +164,7 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) } else { $scope.selected.state = "Idle"; + $scope.selected.class = "hide"; } }; diff --git a/partials/visualisation.html b/partials/visualisation.html index b3f8631..78d6da6 100644 --- a/partials/visualisation.html +++ b/partials/visualisation.html @@ -75,6 +75,20 @@

{{selected.name}}

State: {{selected.state}}

+

+ Current Job: + + {{selected.currentBuild.sourceStamps[0].changes[0].at}} + / Job ID: {{selected.currentBuild.number}} + +

+

Current Job logs:

+ +

Last Job: diff --git a/style.css b/style.css index b0e696c..03d899a 100644 --- a/style.css +++ b/style.css @@ -136,3 +136,7 @@ h1>em>a:hover { :not(.active) > .progress { display: none; } + +.hide { + display: none; +} -- cgit v1.2.1