Skip to content

Commit

Permalink
ActiveMQ destination query improvements - provide a way to see all at…
Browse files Browse the repository at this point in the history
…tributes and reset page on refresh
  • Loading branch information
dejanb committed Sep 27, 2016
1 parent 9507c32 commit 1d8be8f
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<option ng-repeat="option in destinationFilterOptions" value="{{option.id}}">{{option.name}}
</option>
</select>
<button class="btn" ng-click="loadTable()"
<button class="btn" ng-click="refresh()"
title="Filter">
<i class="icon-refresh"></i>
</button>
Expand All @@ -28,7 +28,7 @@


<div class="row-fluid">
<div class="gridStyle" ng-grid="gridOptions"></div>
<div class="gridStyle" ng-grid="gridOptions" ui-grid-resize-columns></div>
</div>

</div>
158 changes: 140 additions & 18 deletions hawtio-web/src/main/webapp/app/activemq/js/destinations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,163 @@ module ActiveMQ {
directions: ["asc"]
};

var refreshed = false;

var attributes = [];
var hiddenAttributes = [
{
field: 'inFlightCount',
displayName: 'In-flight Count',
visible: false
},
{
field: 'expiredCount',
displayName: 'Expired Count',
visible: false
},
{
field: 'memoryPercentUsage',
displayName: 'Memory Percent Usage [%]',
visible: false
},
{
field: 'memoryLimit',
displayName: 'Memory Limit',
visible: false
},
{
field: 'memoryUsageByteCount',
displayName: 'Memory Usage Byte Count',
visible: false
},
{
field: 'memoryUsagePortion',
displayName: 'Memory Usage Portion',
visible: false
},
{
field: 'forwardCount',
displayName: 'Forward Count',
visible: false
},
{
field: 'maxAuditDepth',
displayName: 'Max Audit Depth',
visible: false
},
{
field: 'maxEnqueueTime',
displayName: 'Max Enqueue Time',
visible: false
},
{
field: 'maxMessageSize',
displayName: 'Max Message Size',
visible: false
},
{
field: 'maxPageSize',
displayName: 'Max Page Size',
visible: false
},
{
field: 'maxProducersToAudit',
displayName: 'Max Producers To Audit',
visible: false
},
{
field: 'messagesCached',
displayName: 'Messages Cached',
visible: false
},
{
field: 'minEnqueueTime',
displayName: 'Min Enqueue Time',
visible: false
},
{
field: 'minMessageSize',
displayName: 'Min Message Size',
visible: false
},
{
field: 'options',
displayName: 'Options',
visible: false
},
{
field: 'storeMessageSize',
displayName: 'Store Message Size',
visible: false
},
{
field: 'totalBlockedTime',
displayName: 'Totel Blocked Time',
visible: false
},
{
field: 'dlq',
displayName: 'DLQ?',
visible: false
},
{
field: 'enableAudit',
displayName: 'Audit Enabled?',
visible: false
},
{
field: 'prioritizedMessages',
displayName: 'Prioritized Messages?',
visible: false
},
{
field: 'producerFlowControl',
displayName: 'Producer Flow Control?',
visible: false
},
{
field: 'useCache',
displayName: 'Use Cache?',
visible: false
}
];

if ($scope.destinationType == 'topic') {
$scope.destinationFilterOptions.push({id: "nonAdvisory", name: "No Advisory Topics"});
$scope.destinationFilterPlaceholder = "Filter Topic Names...";
attributes = [
{
field: 'name',
displayName: 'Name',
width: '20%'
width: '*'
},
{
field: 'producerCount',
displayName: 'Producer Count',
width: '10%'
width: '10%',
},
{
field: 'consumerCount',
displayName: 'Consumer Count',
width: '10%'
width: '10%',
},
{
field: 'enqueueCount',
displayName: 'Enqueue Count',
width: '10%'
width: '10%',
},
{
field: 'dequeueCount',
displayName: 'Dequeue Count',
width: '10%'
width: '10%',
},
{
field: 'dispatchCount',
displayName: 'Dispatch Count',
width: '10%'
width: '10%',
}
];
attributes = attributes.concat(hiddenAttributes);
} else {
$scope.destinationFilterOptions.push({id: "empty", name: "Only Empty"});
$scope.destinationFilterOptions.push({id: "nonEmpty", name: "Only Non-Empty"});
Expand All @@ -80,7 +201,7 @@ module ActiveMQ {
{
field: 'name',
displayName: 'Name',
width: '20%',
width: '*',
cellTemplate: '<div class="ngCellText"><a href="#/activemq/browseQueue?tab=activemq&queueName={{row.entity.name}}">{{row.entity.name}}</a></div>'
},
{
Expand Down Expand Up @@ -108,22 +229,13 @@ module ActiveMQ {
displayName: 'Dequeue Count',
width: '10%'
},
{
field: 'inFlightCount',
displayName: 'In-flight Count',
width: '10%'
},
{
field: 'dispatchCount',
displayName: 'Dispatch Count',
width: '10%'
},
{
field: 'memoryPercentUsage',
displayName: 'Memory Percent Usage [%]',
width: '10%'
},
}
];
attributes = attributes.concat(hiddenAttributes);
}

$scope.gridOptions = {
Expand Down Expand Up @@ -154,6 +266,11 @@ module ActiveMQ {
useExternalSorting: true
};

$scope.refresh = function() {
refreshed = true;
$scope.loadTable();
};

$scope.loadTable = function() {
$scope.destinationFilter.name = $scope.gridOptions.filterOptions.filterText;
$scope.destinationFilter.sortColumn = $scope.sortOptions.fields[0];
Expand Down Expand Up @@ -184,6 +301,11 @@ module ActiveMQ {
});
$scope.totalServerItems = data["count"];

if (refreshed == true) {
$scope.gridOptions.pagingOptions.currentPage = 1;
refreshed = false;
}

Core.$apply($scope);
}

Expand Down

0 comments on commit 1d8be8f

Please sign in to comment.