Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Activiti spring boot starter endpoint #64

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/.settings
/.classpath
/.project

spring-boot-admin-samples/spring-boot-admin-sample/boot-admin-sample.log
20 changes: 20 additions & 0 deletions spring-boot-admin-server-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ npm install
gulp watch
```

#### Building on windows

Install gulp globally - http://omcfarlane.co.uk/install-gulp-js-windows/

Update the maven pom to run gulp directly
```shell
<configuration>
<executable>gulp</executable>
<arguments>
<argument>--skipTests=${skipTests}</argument>
</arguments>
</configuration>
```

Update the packages json
```shell
"postinstall": "node node_modules/protractor/bin/webdriver-manager update",
"pretest": "node node_modules/protractor/bin/webdriver-manager start &",
"test": "node node_modules/gulp/bin/gulp.js"
```
5 changes: 5 additions & 0 deletions spring-boot-admin-server-ui/app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ springBootAdmin.config(function ($stateProvider, $urlRouterProvider) {
templateUrl: 'views/apps/details/classpath.html',
controller: 'detailsClasspathCtrl'
})
.state('apps.activiti', {
url: '/activiti',
templateUrl: 'views/apps/activiti.html',
controller: 'activitiCtrl'
})
.state('apps.logging', {
url: '/logging',
templateUrl: 'views/apps/logging.html',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';

module.exports = function ($scope, application) {
$scope.application = application;
application.getActiviti()
.success(function (activiti){
$scope.summary = [];
$scope.summary.push({
key: 'Completed Task Count Today',
value: activiti.completedTaskCountToday
});
$scope.summary.push({
key: 'Process Definition Count',
value: activiti.processDefinitionCount
});
$scope.summary.push({
key: 'Cached Process Definition Count',
value: activiti.cachedProcessDefinitionCount
});
$scope.summary.push({
key: 'Completed Task Count',
value: activiti.completedTaskCount
});
$scope.summary.push({
key: 'Completed Activities',
value: activiti.completedActivities
});
$scope.summary.push({
key: 'Open Task Count',
value: activiti.openTaskCount
});
$scope.processes = [];
angular.forEach(activiti.deployedProcessDefinitions, function(value, key) {
var runningProcessInstanceCount = activiti.runningProcessInstanceCount[value];
var completedProcessInstanceCount = activiti.completedProcessInstanceCount[value];
this.push({
name: value,
running: runningProcessInstanceCount,
completed: completedProcessInstanceCount
});
}, $scope.processes);
})
.error(function (error) {
$scope.error = error;
});
};
1 change: 1 addition & 0 deletions spring-boot-admin-server-ui/app/js/controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ springBootAdmin.controller('detailsMetricsCtrl', require('./apps/details/metrics
springBootAdmin.controller('detailsEnvCtrl', require('./apps/details/envCtrl'));
springBootAdmin.controller('detailsPropsCtrl', require('./apps/details/propsCtrl'));
springBootAdmin.controller('detailsClasspathCtrl', require('./apps/details/classpathCtrl'));
springBootAdmin.controller('activitiCtrl', require('./apps/activitiCtrl'));
springBootAdmin.controller('loggingCtrl', require('./apps/loggingCtrl'));
springBootAdmin.controller('jmxCtrl', require('./apps/jmxCtrl'));
springBootAdmin.controller('threadsCtrl', require('./apps/threadsCtrl'));
Expand Down
12 changes: 11 additions & 1 deletion spring-boot-admin-server-ui/app/js/controller/overviewCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ module.exports = function ($scope, $location, $interval, $q, Application) {
app.providesLogfile = false;
});
};
var getActiviti = function (app) {
return app.getActiviti()
.success(function () {
app.providesActiviti = true;
})
.error(function () {
app.providesActiviti = false;
});
};

$scope.loadData = function () {
Application.query(function (applications) {
Expand All @@ -63,11 +72,12 @@ module.exports = function ($scope, $location, $interval, $q, Application) {
app.version = $scope.applications[j].version;
app.status = $scope.applications[j].status;
app.providesLogfile = $scope.applications[j].providesLogfile;
app.providesActiviti = $scope.applications[j].providesActiviti;
break;
}
}
app.refreshing = true;
$q.all(getInfo(app), getHealth(app), getLogfile(app))
$q.all(getInfo(app), getHealth(app), getLogfile(app), getActiviti(app))
.finally(function () {
app.refreshing = false;
});
Expand Down
4 changes: 4 additions & 0 deletions spring-boot-admin-server-ui/app/js/service/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = function ($resource, $http, $rootScope) {
return $http.get('api/applications/' + this.id + '/trace').error(new AuthInterceptor(this));
};

Application.prototype.getActiviti = function () {
return $http.get('api/applications/' + this.id + '/activiti').error(new AuthInterceptor(this));
};

Application.prototype.hasLogfile = function () {
return $http.head('api/applications/' + this.id + '/logfile').error(new AuthInterceptor(this));
};
Expand Down
1 change: 1 addition & 0 deletions spring-boot-admin-server-ui/app/views/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<li class="navbar-link" ui-sref-active="active" ><a ui-sref="apps.jmx({id: application.id})">JMX</a></li>
<li class="navbar-link" ui-sref-active="active" ><a ui-sref="apps.threads({id: application.id})">Threads</a></li>
<li class="navbar-link" ui-sref-active="active" ><a ui-sref="apps.trace({id: application.id})">Trace</a></li>
<li class="navbar-link" ui-sref-active="active" ><a ui-sref="apps.activiti({id: application.id})">Activiti</a></li>
</ul>
<small class="navbar-text">{{ application.url }}</small>
</div>
Expand Down
36 changes: 36 additions & 0 deletions spring-boot-admin-server-ui/app/views/apps/activiti.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="container content">
<table class="table table-striped">
<col style="width:30%">
<col style="width:auto">
<thead>
<tr>
<th colspan="2">Overview <small class="pull-right"><a href="{{ application.url }}/activiti">raw JSON</a></small></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="entry in summary" >
<td style="word-break: break-all;" >{{ entry.key }}</td>
<td style="word-break: break-all;" >{{ entry.value }}</td>
</tr>
</tbody>
</table>
<table class="table table-striped">
<col style="width:30%">
<col style="width:auto">
<thead>
<tr>
<th>Processes</th>
</tr>
</thead>
<tbody>
<tr class="highlight">
<td>Name</td><td>Running</td><td>Completed</td>
</tr>
<tr ng-repeat="process in processes" >
<td style="word-break: break-all;" >{{ process.name }}</td>
<td style="word-break: break-all;" >{{ process.running }}</td>
<td style="word-break: break-all;" >{{ process.completed }}</td>
</tr>
</tbody>
</table>
</div>
1 change: 1 addition & 0 deletions spring-boot-admin-server-ui/app/views/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h2 >Spring-Boot applications<br>
<li><a ui-sref="apps.jmx({id: application.id})" >JMX</a></li>
<li><a ui-sref="apps.threads({id: application.id})" >Threads</a></li>
<li><a ui-sref="apps.trace({id: application.id})" >Trace</a></li>
<li><a ui-sref="apps.activiti({id: application.id})" >Activiti</a></li>
</ul>
</div>
<div class="btn-group" title="remove">
Expand Down