Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
adding version output to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrinor2002 committed May 4, 2017
1 parent 22e4344 commit 993b347
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const good = require('good');
const _ = require('lodash');
const url = require('url');

const packageInfo = require('./package.json');

const baseForward = {
protocol: process.env.CONCOURSE_URL_PROTOCOL || 'https',
slashes: true,
Expand All @@ -30,6 +32,12 @@ function getEnv(request, reply) {
return _.startsWith(key, 'JS_');
});

_.extend(frontEndEnv, {
package: _.pick(packageInfo, [
'version'
])
});

reply(frontEndEnv);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "concourse-workbench",
"private": true,
"version": "1.0.0",
"version": "0.4-beta4",
"description": "Provides a one page web application to monitor concourse job states.",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions public/css/workbench.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@
.pipe .status-bar .pending .js-animation-wrapper {
display: block;
}

.lower-right-info td{
white-space: nowrap;
}
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
</div>
</div>
</div>
<table class="lower-right-info">
<tr><td> workbench: v<span class="number">{{ jsenv.package.version }}</span> </td></tr>
<tr><td> concourse: v<span class="number">{{ concourseInfo.version }}</span> </td></tr>
</table>
</div>
<script>

Expand Down Expand Up @@ -310,6 +314,22 @@
$scope.jsenv = jsenv;
}

// get and set the JSInfo
$scope.concourseInfo = { version: 'N/A' }
$scope.getInfo = function() {
$http({
method: 'GET',
url: '/c/api/v1/info'
}).then(function(response) {
$scope.setInfo(response.data);
}, function(err) {
console.error(err);
});
}
$scope.setInfo = function(jsinfo) {
$scope.concourseInfo = jsinfo;
}

var pathSearch = $window.location.pathname.split('/').slice(1);
pathSearch = pathSearch[0] === 'search' ? pathSearch.slice(1).join('/') : false;
$scope.getPipes = function() {
Expand Down Expand Up @@ -406,6 +426,7 @@
}

$scope.getPipes();
$scope.getInfo();
$scope.getJSEnv();

// setup auto refresh
Expand Down

0 comments on commit 993b347

Please sign in to comment.