Skip to content

Commit

Permalink
#786: Quartz plugin. Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Dec 31, 2013
1 parent 252ea08 commit dd0c977
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
30 changes: 23 additions & 7 deletions hawtio-web/src/main/webapp/app/quartz/html/schedulers.html
Expand Up @@ -22,6 +22,7 @@
<div ng-show="selectedSchedulerMBean">

<div class="row-fluid">

<div class="pull-right">
<form class="form-inline no-bottom-margin">
<fieldset>
Expand All @@ -40,7 +41,6 @@
</fieldset>
</form>
</div>

<div class="row-fluid">
<dl class="dl-horizontal">
<dt>Scheduler name</dt>
Expand All @@ -50,29 +50,45 @@
<dt>Version</dt>
<dd>{{selectedScheduler.Version}}</dd>
<dt>State</dt>
<dd><i class="{{selectedSchedulerIcon}}"></i></dd>
<dt>Shutdown</dt>
<dd>{{selectedScheduler.Shutdown}}</dd>
<dd><i class="{{renderIcon(selectedScheduler.Started)}}"></i></dd>
</dl>
</div>

<div class="pull-right">
<form class="form-inline no-bottom-margin">
<fieldset>
<div class="controls control-group inline-block controls-row">
<div class="btn-group">
<button
ng-disabled="selectedScheduler.SampledStatisticsEnabled"
class="btn" ng-click="enableSampleStatistics()" title="Enable Statistics">
<i class="icon-play-circle"></i></button>
<button
ng-disabled="!selectedScheduler.SampledStatisticsEnabled"
class="btn" ng-click="disableSampleStatistics()" title="Disable Statistics">
<i class="icon-off"></i></button>
</div>
</div>
</fieldset>
</form>
</div>
<div>
<dl class="dl-horizontal">
<dt>JobStore ClassName</dt>
<dd>{{selectedScheduler.JobStoreClassName}}</dd>
<dt>Jobs Completed most recent sample</dt>
<dd>{{selectedScheduler.JobsCompletedMostRecentSample}}</dd>
<dt>Jobs Executed most recent sample</dt>
<dd>{{selectedScheduler.JobsExecutedMostRecentSample}}</dd>
<dt>Jobs Scheduled most recent sample</dt>
<dd>{{selectedScheduler.JobsScheduledMostRecentSample}}</dd>
<dt>Sampled Statistics Enabled</dt>
<dd>{{selectedScheduler.SampledStatisticsEnabled}}</dd>
<dd><i class="{{renderIcon(selectedScheduler.SampledStatisticsEnabled)}}"></i></dd>
</dl>
</div>

<div>
<dl class="dl-horizontal">
<dt>JobStore ClassName</dt>
<dd>{{selectedScheduler.JobStoreClassName}}</dd>
<dt>Thread Pool ClassName</dt>
<dd>{{selectedScheduler.ThreadPoolClassName}}</dd>
<dt>Thread Pool Size</dt>
Expand Down
19 changes: 16 additions & 3 deletions hawtio-web/src/main/webapp/app/quartz/js/quartz.ts
Expand Up @@ -13,7 +13,6 @@ module Quartz {

$scope.valueDetails = new Core.Dialog();

$scope.selectedSchedulerIcon = null;
$scope.selectedScheduler = null;
$scope.selectedSchedulerMBean = null;
$scope.triggers = [];
Expand Down Expand Up @@ -126,6 +125,10 @@ module Quartz {
}
};

$scope.renderIcon = (state) => {
return Quartz.iconClass(state);
}

$scope.renderQuartz = (response) => {
$scope.selectedSchedulerDetails = [];

Expand All @@ -140,8 +143,6 @@ module Quartz {
$scope.selectedScheduler = obj;
}

$scope.selectedSchedulerIcon = Quartz.iconClass(obj.Started);

// grab state for all triggers which requires to call a JMX operation per trigger
obj.AllTriggers.forEach(t => {
var state = jolokia.request({type: "exec", mbean: $scope.selectedSchedulerMBean,
Expand Down Expand Up @@ -217,6 +218,18 @@ module Quartz {
}
}

$scope.enableSampleStatistics = () => {
if ($scope.selectedSchedulerMBean) {
jolokia.setAttribute($scope.selectedSchedulerMBean, "SampledStatisticsEnabled", true);
}
}

$scope.disableSampleStatistics = () => {
if ($scope.selectedSchedulerMBean) {
jolokia.setAttribute($scope.selectedSchedulerMBean, "SampledStatisticsEnabled", false);
}
}

$scope.pauseTrigger = () => {
if ($scope.gridOptions.selectedItems.length === 1) {
var groupName = $scope.gridOptions.selectedItems[0].group;
Expand Down

0 comments on commit dd0c977

Please sign in to comment.