Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit e9c48e2

Browse files
ghillerttrisberg
authored andcommitted
gh-91 Include environment info in the About tab
* Add link to details page on About page * Add ability to copy environment info to clipboard * gh-160 Download links shall use core version
1 parent 6ca5bc9 commit e9c48e2

File tree

12 files changed

+312
-17
lines changed

12 files changed

+312
-17
lines changed

ui/Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = function (grunt) {
105105
context: [
106106
'/authenticate', '/batch', '/tasks', '/jobs', '/logout', '/meta', '/apps', '/streams',
107107
'/runtime', '/validation', '/management', '/dashboard', '/security', '/completions',
108-
'/metrics', '/features', '/login'],
108+
'/metrics', '/features', '/login', '/about'],
109109
host: 'localhost',
110110
port: 9393,
111111
changeOrigin: true

ui/app/scripts/app/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ define([
2727
'cgBusy',
2828
'ngAnimate',
2929
'ngGrowl',
30+
'ngclipboard',
3031
'ngBootstrap',
3132
'ngIndeterminate',
3233
'./controllers',

ui/app/scripts/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ require.config({
3232
jquery: '../lib/jquery/jquery',
3333
bootstrap: '../lib/bootstrap/bootstrap',
3434
ngResource: '../lib/angular-resource/angular-resource',
35+
ngclipboard: '../lib/ngclipboard/ngclipboard',
36+
clipboard: '../lib/clipboard/clipboard',
3537
uiRouter: '../lib/angular-ui-router/angular-ui-router',
3638
cgBusy: '../lib/angular-busy/angular-busy',
3739
ngGrowl: '../lib/angular-growl-v2/angular-growl',
@@ -80,6 +82,9 @@ require.config({
8082
'cgBusy': {
8183
deps: ['angular']
8284
},
85+
'ngclipboard': {
86+
deps: ['clipboard', 'angular']
87+
},
8388
'ngGrowl': {
8489
deps: ['angular', 'ngAnimate']
8590
},
@@ -116,6 +121,11 @@ require.config({
116121
}
117122
});
118123

124+
require(['clipboard'], function(clipboard) {
125+
'use strict';
126+
window.Clipboard = clipboard;
127+
});
128+
119129
define([
120130
'require',
121131
'angular'

ui/app/scripts/routes.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ define(['./app'], function (dashboard) {
130130
authenticate: false
131131
}
132132
})
133+
.state('home.about-details', {
134+
url : 'about-details',
135+
controller: 'AboutDetailsController',
136+
templateUrl : sharedTemplatesPath + '/about-details.html',
137+
data:{
138+
authenticate: false
139+
}
140+
})
133141
.state('login', {
134142
url : '/login',
135143
controller: 'LoginController',

ui/app/scripts/shared/controllers.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@
2222
define(['angular'], function (angular) {
2323
'use strict';
2424

25-
return angular.module('dataflowShared.controllers', [])
25+
return angular.module('dataflowShared.controllers', ['ngclipboard'])
2626
.controller('AboutController',
2727
['$scope', '$injector', function ($scope, $injector) {
2828
require(['shared/controllers/about'], function (aboutController) {
2929
$injector.invoke(aboutController, this, {'$scope': $scope});
3030
});
31+
}])
32+
.controller('AboutDetailsController',
33+
['$scope', '$injector', function ($scope, $injector) {
34+
require(['shared/controllers/about-details'], function (aboutDetailsController) {
35+
$injector.invoke(aboutDetailsController, this, {'$scope': $scope});
36+
});
3137
}]);
3238
});
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2014-2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/**
17+
* About Controller logic.
18+
*
19+
* @author Gunnar Hillert
20+
*/
21+
define([], function () {
22+
'use strict';
23+
24+
return ['$scope', 'dataflowVersionInfo', '$state', 'DataflowUtils',
25+
function ($scope, dataflowVersionInfo, $state, utils) {
26+
$scope.$apply(function () {
27+
console.log(dataflowVersionInfo);
28+
$scope.dataflowVersionInfo = dataflowVersionInfo;
29+
});
30+
$scope.goBack = function() {
31+
$state.go('home.about');
32+
};
33+
34+
$scope.isEmpty = function(obj) {
35+
for(var prop in obj) {
36+
if(obj.hasOwnProperty(prop)) {
37+
return false;
38+
}
39+
}
40+
return true;
41+
};
42+
43+
$scope.onCopyToClipboardSuccess = function(e) {
44+
utils.growl.success('Copied About Details to Clipboard (As JSON).');
45+
e.clearSelection();
46+
};
47+
}
48+
];
49+
});

ui/app/scripts/shared/controllers/about.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
define([], function () {
2222
'use strict';
2323

24-
return ['$scope', 'dataflowVersionInfo',
25-
function ($scope, dataflowVersionInfo) {
24+
return ['$scope', 'dataflowVersionInfo', '$state',
25+
function ($scope, dataflowVersionInfo, $state) {
2626
$scope.$apply(function () {
2727
console.log(dataflowVersionInfo);
2828
$scope.dataflowVersionInfo = dataflowVersionInfo;
2929
});
30+
31+
$scope.goToDetails = function() {
32+
$state.go('home.about-details');
33+
};
3034
}
3135
];
3236
});

ui/app/scripts/shared/services.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ define(function (require) {
2424

2525
var angular = require('angular');
2626
require('xregexp');
27-
2827
return angular.module('dataflowShared.services', [])
2928
.factory('DataflowUtils', function ($log, growl, $timeout, $q, $rootScope) {
3029

@@ -65,7 +64,7 @@ define(function (require) {
6564
.factory('ParserService',require('shared/services/parser'))
6665
.factory('dataflowVersionInfo', function ($resource, $rootScope, DataflowUtils) {
6766
console.log('dataflowVersionInfo');
68-
var dataflowVersionInfoPromise = $resource($rootScope.dataflowServerUrl + '/management/info', {}, {
67+
var dataflowVersionInfoPromise = $resource($rootScope.dataflowServerUrl + '/about', {}, {
6968
query: {
7069
method: 'GET'
7170
}
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<h1>About Details</h1>
2+
3+
<h2>Data Flow Server Implementation</h2>
4+
5+
<table class="table table-hover">
6+
<tbody>
7+
<tr>
8+
<td class="col-xs-6">Name</td><td>{{dataflowVersionInfo.versionInfo.implementation.name}}</td>
9+
</tr>
10+
<tr>
11+
<td class="col-xs-6">Version</td><td>{{dataflowVersionInfo.versionInfo.implementation.version}} ({{dataflowVersionInfo.versionInfo.shortCommitId}}) </td>
12+
</tr>
13+
</tbody>
14+
</table>
15+
16+
<h2>Enabled Features</h2>
17+
18+
<table class="table table-hover">
19+
<tbody>
20+
<tr>
21+
<td class="col-xs-6">Analytics</td>
22+
<td>
23+
<span ng-show="dataflowVersionInfo.featureInfo.analyticsEnabled" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
24+
<span ng-hide="dataflowVersionInfo.featureInfo.analyticsEnabled" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
25+
</td>
26+
</tr>
27+
<tr>
28+
<td class="col-xs-6">Streams</td>
29+
<td>
30+
<span ng-show="dataflowVersionInfo.featureInfo.streamsEnabled" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
31+
<span ng-hide="dataflowVersionInfo.featureInfo.streamsEnabled" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
32+
</td>
33+
</tr>
34+
<tr>
35+
<td class="col-xs-6">Tasks</td>
36+
<td>
37+
<span ng-show="dataflowVersionInfo.featureInfo.tasksEnabled" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
38+
<span ng-hide="dataflowVersionInfo.featureInfo.tasksEnabled" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
39+
</td>
40+
</tr>
41+
</tbody>
42+
</table>
43+
44+
<h2>Security Information</h2>
45+
46+
<table class="table table-hover">
47+
<tbody>
48+
<tr>
49+
<td class="col-xs-6">Authentication Enabled</td>
50+
<td>
51+
<span ng-show="dataflowVersionInfo.securityInfo.authenticationEnabled" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
52+
<span ng-hide="dataflowVersionInfo.securityInfo.authenticationEnabled" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
53+
</td>
54+
</tr>
55+
<tr>
56+
<td class="col-xs-6">Authorization Enabled</td>
57+
<td>
58+
<span ng-show="dataflowVersionInfo.securityInfo.authorizationEnabled" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
59+
<span ng-hide="dataflowVersionInfo.securityInfo.authorizationEnabled" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
60+
</td>
61+
</tr>
62+
<tr>
63+
<td class="col-xs-6">Form Login</td>
64+
<td>
65+
<span ng-show="dataflowVersionInfo.securityInfo.formLogin" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
66+
<span ng-hide="dataflowVersionInfo.securityInfo.formLogin" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
67+
</td>
68+
</tr>
69+
<tr>
70+
<td class="col-xs-6">Authenticated</td>
71+
<td>
72+
<span ng-show="dataflowVersionInfo.securityInfo.authenticated" class="glyphicon glyphicon-ok text-success" aria-label="true"></span>
73+
<span ng-hide="dataflowVersionInfo.securityInfo.authenticated" class="glyphicon glyphicon-remove text-danger" aria-label="false"></span>
74+
</td>
75+
</tr>
76+
<tr>
77+
<td class="col-xs-6">Username</td>
78+
<td>{{dataflowVersionInfo.securityInfo.username || 'N/A'}}</td>
79+
</tr>
80+
<tr>
81+
<td class="col-xs-6">Roles</td>
82+
<td>{{dataflowVersionInfo.securityInfo.roles}}</td>
83+
</tr>
84+
</tbody>
85+
</table>
86+
87+
<h2>Version Information</h2>
88+
89+
<table class="table table-hover">
90+
<tbody>
91+
<tr>
92+
<td class="col-xs-6">Implementation</td><td>{{dataflowVersionInfo.versionInfo.implementation.version}} ({{dataflowVersionInfo.versionInfo.implementation.name}})</td>
93+
</tr>
94+
<tr>
95+
<td class="col-xs-6">Core</td><td>{{dataflowVersionInfo.versionInfo.core.version}} ({{dataflowVersionInfo.versionInfo.core.name}})</td>
96+
</tr>
97+
<tr>
98+
<td class="col-xs-6">Dashboard</td><td>{{dataflowVersionInfo.versionInfo.dashboard.version}} ({{dataflowVersionInfo.versionInfo.dashboard.name}})</td>
99+
</tr>
100+
</tbody>
101+
</table>
102+
103+
<h2>Runtime Environment - App Deployer</h2>
104+
105+
<table class="table table-hover">
106+
<tbody>
107+
<tr>
108+
<td class="col-xs-6">Implementation Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.deployerImplementationVersion}}</td>
109+
</tr>
110+
<tr>
111+
<td class="col-xs-6">Name</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.deployerName}}</td>
112+
</tr>
113+
<tr>
114+
<td class="col-xs-6">Spi Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.deployerSpiVersion}}</td>
115+
</tr>
116+
<tr>
117+
<td class="col-xs-6">Java Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.javaVersion}}</td>
118+
</tr>
119+
<tr>
120+
<td class="col-xs-6">Platform Api Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.platformApiVersion}}</td>
121+
</tr>
122+
<tr>
123+
<td class="col-xs-6">Platform Client Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.platformClientVersion}}</td>
124+
</tr>
125+
<tr>
126+
<td class="col-xs-6">Platform Host Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.platformHostVersion}}</td>
127+
</tr>
128+
<tr>
129+
<td class="col-xs-6">Platform Type</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.platformType}}</td>
130+
</tr>
131+
<tr>
132+
<td class="col-xs-6">Spring Boot Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.springBootVersion}}</td>
133+
</tr>
134+
<tr>
135+
<td class="col-xs-6">Spring Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.appDeployer.springVersion}}</td>
136+
</tr>
137+
</tbody>
138+
</table>
139+
140+
<h2>Platform-specific Information of the App Deployer</h2>
141+
142+
<table class="table table-hover">
143+
<tbody>
144+
<tr ng-show="!isEmpty(dataflowVersionInfo.runtimeEnvironment.appDeployer.platformSpecificInfo)" ng-repeat="(key, value) in dataflowVersionInfo.runtimeEnvironment.appDeployer.platformSpecificInfo">
145+
<td class="col-xs-6">{{key}}</td><td>{{value}}</td>
146+
</tr>
147+
<tr ng-show="isEmpty(dataflowVersionInfo.runtimeEnvironment.appDeployer.platformSpecificInfo)">
148+
<td class="col-xs-12 text-center" colspan="2">No platform-specific app deployer information available.</td>
149+
</tr>
150+
</tbody>
151+
</table>
152+
153+
<h2>Runtime Environment - Task Launcher</h2>
154+
155+
<table class="table table-hover">
156+
<tbody>
157+
<tr>
158+
<td class="col-xs-6">ImplementationVersion</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.deployerImplementationVersion}}</td>
159+
</tr>
160+
<tr>
161+
<td class="col-xs-6">Name</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.deployerName}}</td>
162+
</tr>
163+
<tr>
164+
<td class="col-xs-6">Spi Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.deployerSpiVersion}}</td>
165+
</tr>
166+
<tr>
167+
<td class="col-xs-6">Java Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.javaVersion}}</td>
168+
</tr>
169+
<tr>
170+
<td class="col-xs-6">Platform Api Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformApiVersion}}</td>
171+
</tr>
172+
<tr>
173+
<td class="col-xs-6">Platform Client Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformClientVersion}}</td>
174+
</tr>
175+
<tr>
176+
<td class="col-xs-6">Platform Host Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformHostVersion}}</td>
177+
</tr>
178+
<tr>
179+
<td class="col-xs-6">Platform Type</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformType}}</td>
180+
</tr>
181+
<tr>
182+
<td class="col-xs-6">Spring Boot Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.springBootVersion}}</td>
183+
</tr>
184+
<tr>
185+
<td class="col-xs-6">Spring Version</td><td>{{dataflowVersionInfo.runtimeEnvironment.taskLauncher.springVersion}}</td>
186+
</tr>
187+
</tbody>
188+
</table>
189+
190+
<h2>Platform-specific Information of the Task Launcher</h2>
191+
192+
<table class="table table-hover">
193+
<tbody>
194+
<tr ng-show="!isEmpty(dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformSpecificInfo)" ng-repeat="(key, value) in dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformSpecificInfo">
195+
<td class="col-xs-6">{{key}}</td><td>{{value}}</td>
196+
</tr>
197+
<tr ng-show="isEmpty(dataflowVersionInfo.runtimeEnvironment.taskLauncher.platformSpecificInfo)">
198+
<td colspan="2" class="col-xs-6 text-center">No platform-specific task launcher information available.</td>
199+
</tr>
200+
</tbody>
201+
</table>
202+
203+
<div class="row">
204+
<div class="col-md-6 text-right"><button id="back-button" type="button" class="btn btn-default" ng-click="goBack()"><span class="glyphicon glyphicon-arrow-left"></span> Back</button></div>
205+
<div class="col-md-6 text-left"><button id="back-button"
206+
ngclipboard data-clipboard-text="{{dataflowVersionInfo | json}}" ngclipboard-success="onCopyToClipboardSuccess(e);"
207+
type="button" class="btn btn-default"><span class="glyphicon glyphicon-copy"></span> Copy Details to Clipboard</button></div>
208+
</div>

0 commit comments

Comments
 (0)