Commit d92b66f3 by Robin Tegg Committed by Johannes Stelzer

Add support for Activiti endpoint

Activiti spring boot starter exposes the /activiti endpoint which is now exposed in the admin ui. See https://spring.io/blog/2015/03/08/getting-started-with-activiti-and-spring-boot for further details on creating a client
parent 742fa8a0
......@@ -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"
```
......@@ -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',
......
/*
* 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 = [];
for (var i = 0; i < activiti.deployedProcessDefinitions.length; i++) {
var process = activiti.deployedProcessDefinitions[i];
var runningProcessInstanceCount = activiti.runningProcessInstanceCount[process];
var completedProcessInstanceCount = activiti.completedProcessInstanceCount[process];
$scope.processes.push({
name: process,
running: runningProcessInstanceCount,
completed: completedProcessInstanceCount
});
}
})
.error(function (error) {
$scope.error = error;
});
};
......@@ -17,4 +17,12 @@
module.exports = function ($scope, application) {
$scope.application = application;
application.getActiviti()
.success(function () {
$scope.application.providesActiviti = true;
})
.error(function () {
$scope.application.providesActiviti = false;
});
};
......@@ -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'));
......
......@@ -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) {
......@@ -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;
});
......
......@@ -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));
};
......
......@@ -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 ng-show="application.providesActiviti" class="navbar-link" ui-sref-active="active" ><a ui-sref="apps.activiti({id: application.id})">Activiti</a></li>
</ul>
</div>
</div>
......
<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.managementUrl }}/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">
<col style="width:auto">
<thead>
<tr>
<th>Process</th><th>Running</th><th>Completed</th>
</tr>
</thead>
<tbody>
<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>
......@@ -33,6 +33,7 @@
<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 ng-show="application.providesActiviti"><a ui-sref="apps.activiti({id: application.id})" >Activiti</a></li>
</ul>
</div>
<div class="btn-group" title="remove">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment