ARTEMIS-3043 - improvements on new console

https://issues.apache.org/jira/browse/ARTEMIS-3043
This commit is contained in:
Andy Taylor 2020-12-18 12:49:21 +00:00 committed by Clebert Suconic
parent 168883df20
commit ea7f001776
15 changed files with 623 additions and 80 deletions

View File

@ -2793,4 +2793,28 @@ public interface AuditLogger extends BasicLogger {
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601742, value = "User {0} is getting the queue count on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void getQueueCount(String user, Object source, Object... args);
static void lastValueKey(Object source) {
LOGGER.lastValueKey(getCaller(), source);
}
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601743, value = "User {0} is getting last-value-key property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void lastValueKey(String user, Object source, Object... args);
static void consumersBeforeDispatch(Object source) {
LOGGER.consumersBeforeDispatch(getCaller(), source);
}
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601744, value = "User {0} is getting consumers-before-dispatch property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void consumersBeforeDispatch(String user, Object source, Object... args);
static void delayBeforeDispatch(Object source) {
LOGGER.delayBeforeDispatch(getCaller(), source);
}
@LogMessage(level = Logger.Level.INFO)
@Message(id = 601745, value = "User {0} is getting delay-before-dispatch property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT)
void delayBeforeDispatch(String user, Object source, Object... args);
}

View File

@ -290,6 +290,26 @@ public interface QueueControl {
@Attribute(desc = "is this queue a last value queue")
boolean isLastValue();
/**
*The key used for the last value queues
*/
@Attribute(desc = "last value key")
String getLastValueKey();
/**
*Return the Consumers Before Dispatch
* @return
*/
@Attribute(desc = "Return the Consumers Before Dispatch")
int getConsumersBeforeDispatch();
/**
*Return the Consumers Before Dispatch
* @return
*/
@Attribute(desc = "Return the Consumers Before Dispatch")
long getDelayBeforeDispatch();
// Operations ----------------------------------------------------
/**

View File

@ -46,6 +46,7 @@ var Artemis = (function (Artemis) {
<artemis-tree></artemis-tree>
</div>
<div class="tree-nav-main">
<jmx-header></jmx-header>
<artemis-navigation></artemis-navigation>
<div class="contents" ng-view></div>
</div>

View File

@ -28,6 +28,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
action-buttons="$ctrl.tableActionButtons"
items="$ctrl.addresses">
@ -59,17 +60,48 @@ var Artemis;
function AddressesController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisAddress) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allAddresses = [];
ctrl.addresses = [];
ctrl.workspace = workspace;
ctrl.refreshed = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "Name", visible: true},
{name: "Routing Types", visible: true},
{name: "Queue Count", visible: true}
]
};
Artemis.log.debug('sessionStorage: addressColumnDefs =', localStorage.getItem('addressColumnDefs'));
if (localStorage.getItem('addressColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('addressColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('addressColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'ID', name: 'ID'},
{id: 'NAME', name: 'Name'},
{id: 'ROUTING_TYPES', name: 'Queue Count'},
{id: 'QUEUE_COUNT', name: 'User'}
{id: 'id', name: 'ID'},
{id: 'name', name: 'Name'},
{id: 'routingTypes', name: 'Routing Types'},
{id: 'queueCount', name: 'Queue Count'}
],
operationOptions: [
{id: 'EQUALS', name: 'Equals'},
@ -139,6 +171,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisAddress.address.address;
artemisAddress.address = null;
}
selectQueues = function (idx) {

View File

@ -65,6 +65,11 @@ var Artemis;
ng-disabled="$ctrl.retryDisabled"
ng-click="$ctrl.openRetryDialog()">Retry Messages
</button>
<button class="btn btn-default primary-action ng-binding ng-scope"
type="button"
title=""
ng-click="$ctrl.showColumns = true">Columns
</button>
</div>
</form>
</div>
@ -72,7 +77,7 @@ var Artemis;
<pf-table-view config="$ctrl.tableConfig"
columns="$ctrl.tableColumns"
items="$ctrl.messages"
dt-options="$ctrl.tableDtOptions"
dt-options="$ctrl.dtOptions"
action-buttons="$ctrl.tableMenuActions">
</pf-table-view>
<div ng-include="'plugin/artemispagination.html'"></div>
@ -147,6 +152,33 @@ var Artemis;
<p>{{$ctrl.actionText}}</p>
</div>
</div>
<div class="form-group" ng-show="$ctrl.showColumns">
<button class="btn btn-default" data-toggle="modal" data-target="#myModal">Columns</button>
<div class="modal ng-scope">
<div class="modal-dialog ">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title ng-binding">Column Selector</h4>
</div>
<div class="modal-body">
<table class="table-view-container table table-striped table-bordered table-hover dataTable ng-scope ng-isolate-scope no-footer">
<tbody>
<tr ng-repeat="col in $ctrl.dtOptions.columns">
<td>{{ col.name }}</td>
<td><input type="checkbox" ng-model="col.visible" placeholder="Name" autocomplete="off" id="name"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default ng-binding" ng-click="$ctrl.showColumns = false;$ctrl.updateColumns()">
Close
</button>
</div>
</div>
</div>
</div>
</div>
<script type="text/ng-template" id="browse-instructions.html">
<div>
<p>
@ -174,6 +206,7 @@ var Artemis;
ctrl.moveDisabled = true;
ctrl.retryDisabled = true;
ctrl.pagination = pagination;
ctrl.pagination.reset();
ctrl.filter = '';
ctrl.actionText = '';
@ -200,6 +233,44 @@ var Artemis;
}
}
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "Select", visible: true},
{name: "Message ID", visible: true},
{name: "Type", visible: true},
{name: "Durable", visible: true},
{name: "Priority", visible: true},
{name: "Timestamp", visible: true},
{name: "Expires", visible: true},
{name: "Redelivered", visible: true},
{name: "Large", visible: true},
{name: "Persistent Size", visible: true},
{name: "User ID", visible: true},
{name: "Validated User", visible: true},
{name: "Original Queue (Expiry/DLQ's only)", visible: true}
]
};
Artemis.log.debug('sessionStorage: browseColumnDefs =', localStorage.getItem('browseColumnDefs'));
if (localStorage.getItem('browseColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('browseColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('browseColumnDefs', JSON.stringify(attributes));
}
ctrl.tableConfig = {
onCheckBoxChange: handleCheckBoxChange,
selectionMatchProp: 'messageID',
@ -208,7 +279,7 @@ var Artemis;
ctrl.tableColumns = [
{
itemField: 'messageID',
header: 'messageID'
header: 'Message ID'
},
{
itemField: 'type',
@ -312,9 +383,6 @@ var Artemis;
ctrl.tableMenuActions = [ showConfig, resendConfig ];
ctrl.tableDtOptions = {
order: [[0, "asc"]]
};
ctrl.sysprops = [];
Artemis.log.debug("loaded browse 5" + Artemis.browseQueueModule);
@ -379,7 +447,8 @@ var Artemis;
}
var d = new Date(timestamp);
// "yyyy-MM-dd HH:mm:ss"
return d.getFullYear() + "-" + pad2(d.getMonth()) + "-" + pad2(d.getDay()) + " " + pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds());
//add 1 to month as getmonth returns the position not the actual month
return d.getFullYear() + "-" + pad2(d.getMonth() + 1) + "-" + pad2(d.getDate()) + " " + pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds());
}
var typeLabels = ["default", "1", "object", "text", "bytes", "map", "stream", "embedded"];

View File

@ -29,6 +29,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
action-buttons="$ctrl.tableActionButtons"
items="$ctrl.connections">
@ -71,6 +72,7 @@ var Artemis;
function ConnectionsController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConnection, artemisSession) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allConnections = [];
ctrl.connections = [];
@ -79,16 +81,51 @@ var Artemis;
ctrl.refreshed = false;
ctrl.connectionToDelete = '';
ctrl.closeDialog = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "Client ID", visible: true},
{name: "Users", visible: true},
{name: "Protocol", visible: true},
{name: "Session Count", visible: true},
{name: "Remote Address", visible: true},
{name: "Local Address", visible: true},
{name: "Session ID", visible: true},
{name: "Creation Time", visible: true}
]
};
Artemis.log.debug('localStorage: connectionsColumnDefs =', localStorage.getItem('connectionsColumnDefs'));
if (localStorage.getItem('connectionsColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('connectionsColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
Artemis.log.debug('loaded' + ctrl.dtOptions.columns);
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('connectionsColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'CONNECTION_ID', name: 'ID'},
{id: 'CLIENT_ID', name: 'Client ID'},
{id: 'USERS', name: 'Users'},
{id: 'PROTOCOL', name: 'Protocol'},
{id: 'SESSION_COUNT', name: 'Session Count'},
{id: 'REMOTE_ADDRESS', name: 'Remote Address'},
{id: 'LOCAL_ADDRESS', name: 'Local Address'},
{id: 'SESSION_ID', name: 'Session ID'}
{id: 'connection_id', name: 'ID'},
{id: 'client_id', name: 'Client ID'},
{id: 'users', name: 'Users'},
{id: 'protocol', name: 'Protocol'},
{id: 'session_count', name: 'Session Count'},
{id: 'remote_address', name: 'Remote Address'},
{id: 'local_address', name: 'Local Address'},
{id: 'session_id', name: 'Session ID'}
],
operationOptions: [
{id: 'EQUALS', name: 'Equals'},
@ -106,6 +143,12 @@ var Artemis;
value: "",
sortOrder: "asc",
sortColumn: "connectionID"
},
text: {
fieldText: "Filter Field..",
operationText: "Operation..",
sortOrderText: "ascending",
sortByText: "ID"
}
};
@ -144,6 +187,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[0].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisSession.session.connectionID;
artemisSession.session = null;
}
ctrl.refresh = function () {
@ -180,7 +224,7 @@ var Artemis;
ctrl.pagination.reset();
ctrl.refreshed = false;
}
Artemis.log.debug(JSON.stringify(connectionsFilter));
Artemis.log.info(JSON.stringify(connectionsFilter));
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(connectionsFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
}
};

View File

@ -27,6 +27,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
action-buttons="$ctrl.tableActionButtons"
items="$ctrl.consumers">
@ -69,6 +70,7 @@ var Artemis;
function ConsumersController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConsumer, artemisQueue, artemisAddress, artemisSession) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allConsumers = [];
ctrl.consumers = [];
@ -78,6 +80,41 @@ var Artemis;
ctrl.consumerToDeletesSession = '';
ctrl.consumerToDelete = '';
ctrl.closeDialog = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "Session", visible: true},
{name: "Client ID", visible: true},
{name: "Protocol", visible: true},
{name: "Queue", visible: true},
{name: "Queue Type", visible: true},
{name: "Filter", visible: true},
{name: "Address", visible: true},
{name: "Remote Address", visible: true},
{name: "Local Address", visible: true},
{name: "Creation Time", visible: true}
]
};
Artemis.log.debug('localStorage: consumersColumnDefs =', localStorage.getItem('consumersColumnDefs'));
if (localStorage.getItem('consumersColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('consumersColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('consumersColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'ID', name: 'ID'},
@ -132,7 +169,7 @@ var Artemis;
{ header: 'Client ID', itemField: 'clientID' },
{ header: 'Protocol', itemField: 'protocol' },
{ header: 'Queue', itemField: 'queue', templateFn: function(value, item) { return '<a href="#" onclick="selectQueue(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
{ header: 'queueType', itemField: 'queueType' },
{ header: 'Queue Type', itemField: 'queueType' },
{ header: 'Filter', itemField: 'filter' },
{ header: 'Address', itemField: 'address' , templateFn: function(value, item) { return '<a href="#" onclick="selectAddress(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
{ header: 'Remote Address', itemField: 'remoteAddress' },
@ -164,6 +201,15 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisConsumer.consumer.sessionID;
artemisConsumer.consumer = null;
}
if (artemisQueue.queue) {
Artemis.log.info("navigating to consumer = " + artemisQueue.queue.queue);
ctrl.filter.values.field = ctrl.filter.fieldOptions[5].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisQueue.queue.queue;
artemisQueue.queue = null;
}
selectQueue = function (idx) {
@ -220,6 +266,8 @@ var Artemis;
ctrl.pagination.reset();
ctrl.refreshed = false;
}
Artemis.log.info(JSON.stringify(sessionsFilter));
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(sessionsFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
}
};

View File

@ -44,6 +44,16 @@ var Artemis;
<label>Show internal queues:
<input type="checkbox" ng-model="$ctrl.showInternalQueues">
</label>
<label>Show Live Brokers:
<input type="checkbox" ng-model="$ctrl.showLiveBrokers">
</label>
<label>Show Backup Brokers:
<input type="checkbox" ng-model="$ctrl.showBackupBrokers">
</label>
<label>Show Connectors:
<input type="checkbox" ng-model="$ctrl.showConnectors">
</label>
<button type="submit" class="btn btn-primary"
ng-click="$ctrl.refresh()">Refresh
</button>
@ -81,6 +91,10 @@ var Artemis;
ctrl.showQueues = true;
ctrl.showInternalAddresses = false;
ctrl.showInternalQueues = false;
ctrl.showLiveBrokers = true;
ctrl.showBackupBrokers = true;
ctrl.showConnectors = true;
ctrl.hiddenRelations = [];
$scope.$watch('$ctrl.showAddresses', function () {
if(ctrl.kinds.Address && !ctrl.showAddresses) {
delete ctrl.kinds.Address;
@ -109,6 +123,34 @@ var Artemis;
ctrl.kinds.InternalQueue = true;
}
});
$scope.$watch('$ctrl.showLiveBrokers', function () {
if(ctrl.kinds.ThisBroker && !ctrl.showLiveBrokers) {
delete ctrl.kinds.ThisBroker;
} else if (!ctrl.kinds.ThisBroker && ctrl.showLiveBrokers) {
ctrl.kinds.ThisBroker = true;
}
if(ctrl.kinds.MasterBroker && !ctrl.showLiveBrokers) {
delete ctrl.kinds.MasterBroker;
} else if (!ctrl.kinds.MasterBroker && ctrl.showLiveBrokers) {
ctrl.kinds.MasterBroker = true;
}
});
$scope.$watch('$ctrl.showBackupBrokers', function () {
if(ctrl.kinds.SlaveBroker && !ctrl.showBackupBrokers) {
delete ctrl.kinds.SlaveBroker;
} else if (!ctrl.kinds.SlaveBroker && ctrl.showBackupBrokers) {
ctrl.kinds.SlaveBroker = true;
}
});
$scope.$watch('$ctrl.showConnectors', function () {
if(!ctrl.showConnectors) {
ctrl.data.relations = [];
} else {
ctrl.data.relations = ctrl.hiddenRelations;
}
});
ctrl.datasets = [];
//icons can be found at https://www.patternfly.org/v3/styles/icons/index.html
ctrl.serverIcon = "\ue90d";
@ -157,7 +199,7 @@ var Artemis;
};
load();
ctrl.hiddenRelations = ctrl.relations;
function load() {
ctrl.items = {};

View File

@ -28,6 +28,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
items="$ctrl.producers">
</pf-table-view>
@ -56,12 +57,45 @@ var Artemis;
function ProducersController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisProducer, artemisAddress, artemisSession) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allProducers = [];
ctrl.producers = [];
ctrl.pageNumber = 1;
ctrl.workspace = workspace;
ctrl.refreshed = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "Session", visible: true},
{name: "Client ID", visible: true},
{name: "Protocol", visible: true},
{name: "User", visible: true},
{name: "Address", visible: true},
{name: "Remote Address", visible: true},
{name: "Local Address", visible: true}
]
};
Artemis.log.debug('localStorage: producersColumnDefs =', localStorage.getItem('producersColumnDefs'));
if (localStorage.getItem('producersColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('producersColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('producersColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'ID', name: 'ID'},
@ -148,6 +182,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisProducer.producer.sessionID;
artemisProducer.producer = null;
}
ctrl.loadOperation = function () {

View File

@ -28,6 +28,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
action-buttons="$ctrl.tableActionButtons"
items="$ctrl.queues">
@ -59,28 +60,86 @@ var Artemis;
function QueuesController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisQueue, artemisAddress) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allAddresses = [];
ctrl.queues = [];
ctrl.workspace = workspace;
ctrl.refreshed = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "name", visible: true},
{name: "Address", visible: true},
{name: "Routing Type", visible: true},
{name: "Filter", visible: true},
{name: "Durable", visible: true},
{name: "Max Consumers", visible: true},
{name: "Purge On No Consumers", visible: true},
{name: "Consumer Count", visible: true},
{name: "Rate", visible: true},
{name: "Message Count", visible: true},
{name: "Paused", visible: false},
{name: "Temporary", visible: false},
{name: "Auto Created", visible: false},
{name: "User", visible: false},
{name: "Total Messages Added", visible: false},
{name: "Total Messages Acked", visible: false},
{name: "Delivering Count", visible: false},
{name: "Messages Killed", visible: false},
{name: "Direct Deliver", visible: false},
{name: "Exclusive", visible: false},
{name: "Last Value", visible: false},
{name: "Last Value Key", visible: false},
{name: "Scheduled Count", visible: false},
{name: "Group Rebalance", visible: false},
{name: "Group Rebalance Pause Dispatch", visible: false},
{name: "Group Buckets", visible: false},
{name: "Group First Key", visible: false},
{name: "Queue Enabled", visible: false},
{name: "Ring Size", visible: false},
{name: "Consumers Before Dispatch", visible: false},
{name: "Delay Before Dispatch", visible: false}
]
};
Artemis.log.debug('localStorage: queuesColumnDefs =', localStorage.getItem('queuesColumnDefs'));
if (localStorage.getItem('queuesColumnDefs')) {
Artemis.log.info("loading columns " + localStorage.getItem('queuesColumnDefs'))
loadedDefs = JSON.parse(localStorage.getItem('queuesColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('queuesColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'ID', name: 'ID'},
{id: 'NAME', name: 'Name'},
{id: 'CONSUMER_ID', name: 'Consumer ID'},
{id: 'ADDRESS', name: 'Address'},
{id: 'FILTER', name: 'Filter'},
{id: 'MAX_CONSUMERS', name: 'maxConsumers'},
{id: 'ROUTING_TYPE', name: 'Routing Type'},
{id: 'PURGE_ON_NO_CONSUMERS', name: 'Purge On No Consumers'},
{id: 'USER', name: 'User'},
{id: 'MESSAGE_COUNT', name: 'Message Count'},
{id: 'DELIVERING_COUNT', name: 'Delivering Count'},
{id: 'PAUSED', name: 'Paused'},
{id: 'TEMPORARY', name: 'Temporary'},
{id: 'AUTO_CREATED', name: 'Auto Created'},
{id: 'RATE', name: 'Rate'}
{id: 'id', name: 'ID'},
{id: 'name', name: 'Name'},
{id: 'consumerId', name: 'Consumer ID'},
{id: 'address', name: 'Address'},
{id: 'filter', name: 'Filter'},
{id: 'maxConsumers', name: 'Max Consumers'},
{id: 'routingType', name: 'Routing Type'},
{id: 'purgeOnNoConsumers', name: 'Purge On No Consumers'},
{id: 'user', name: 'User'},
{id: 'messageCount', name: 'Message Count'},
{id: 'deliveringCount', name: 'Delivering Count'},
{id: 'paused', name: 'Paused'},
{id: 'temporary', name: 'Temporary'},
{id: 'autoCreated', name: 'Auto Created'},
{id: 'rate', name: 'Rate'}
],
operationOptions: [
{id: 'EQUALS', name: 'Equals'},
@ -128,16 +187,17 @@ var Artemis;
{ header: 'Name', itemField: 'name',
templateFn: function(value, item) { return '<a href="#" onclick="selectQueue(' + item.idx + ')">' + $sanitize(value) + '</a>' }
},
{ header: 'Routing Types', itemField: 'routingTypes' },
{ header: 'Address', itemField: 'address',
templateFn: function(value, item) { return '<a href="#" onclick="selectAddress(' + item.idx + ')">' + $sanitize(value) + '</a>' }
},
{ header: 'Routing Type', itemField: 'routingType' },
{ header: 'Routing Type', itemField: 'routingType'},
{ header: 'Filter', itemField: 'filter' },
{ header: 'Durable', itemField: 'durable' },
{ header: 'Max Consumers', itemField: 'maxConsumers' },
{ header: 'Purge On No Consumers', itemField: 'purgeOnNoConsumers' },
{ header: 'Consumer Count', itemField: 'consumerCount' },
{ header: 'Consumer Count', itemField: 'consumerCount' ,
templateFn: function(value, item) { return '<a href="#" onclick="selectConsumers(' + item.idx + ')">' + $sanitize(value) + '</a>' }
},
{ header: 'Rate', itemField: 'rate' },
{ header: 'Message Count', itemField: 'messageCount',
templateFn: function(value, item) { return '<a href="#" onclick="browseQueue(' + item.idx + ')" title="Browse Messages">' + value + '</a>' }
@ -150,12 +210,24 @@ var Artemis;
{ header: 'Total Messages Acked', itemField: 'messagesAcked' },
{ header: 'Delivering Count', itemField: 'deliveringCount' },
{ header: 'Messages Killed', itemField: 'messagesKilled' },
{ header: 'Direct Deliver', itemField: 'directDeliver' }
{ header: 'Direct Deliver', itemField: 'directDeliver' },
{ header: 'exclusive', itemField: 'exclusive' },
{ header: 'Last Value', itemField: 'lastValue' },
{ header: 'Last Value Key', itemField: 'lastValueKey' },
{ header: 'Scheduled Count', itemField: 'scheduledCount' },
{ header: 'Group Rebalance', itemField: 'groupRebalance' },
{ header: 'Group Rebalance Pause Dispatch', itemField: 'groupRebalancePauseDispatch' },
{ header: 'Group Buckets', itemField: 'groupBuckets' },
{ header: 'Group First Key', itemField: 'groupFirstKey' },
{ header: 'Enabled', itemField: 'enabled'},
{ header: 'Ring Size', itemField: 'ringSize'},
{ header: 'Consumers Before Dispatch', itemField: 'consumersBeforeDispatch'},
{ header: 'Delay Before Dispatch', itemField: 'delayBeforeDispatch'}
];
ctrl.refresh = function () {
ctrl.refreshed = true;
loadTable();
ctrl.pagination.load();
};
ctrl.reset = function () {
ctrl.filter.values.field = "";
@ -176,6 +248,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisQueue.queue.queue;
artemisQueue.queue = null;
}
if (artemisAddress.address) {
@ -183,10 +256,13 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[3].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisAddress.address.address;
artemisAddress.address = null;
}
function navigateToQueuesAtts(action, item) {
$location.path("artemis/attributes").search({"tab": "artemis", "nid": getQueuesNid(item, $location)});
qnid = getQueuesNid(item, $location);
Artemis.log.info(qnid);
$location.path("artemis/attributes").search({"tab": "artemis", "nid": qnid });
};
function navigateToQueuesOps(action, item) {
$location.path("artemis/operations").search({"tab": "artemis", "nid": getQueuesNid(item, $location)});
@ -201,10 +277,15 @@ var Artemis;
var item = ctrl.queues[idx];
var nid = getQueuesNid(item, $location);
Artemis.log.debug("navigating to queue:" + nid);
artemisAddress.address = { address: item.address };
artemisQueue.queue = item;
artemisQueue.queue = { queue: item.name };
$location.path("artemis/artemisQueues").search({"tab": "artemis", "nid": nid});
};
selectConsumers = function (idx) {
var item = ctrl.queues[idx];
var nid = getQueuesNid(item, $location);
artemisQueue.queue = { queue: item.name };
$location.path("artemis/artemisConsumers").search({"tab": "artemis", "nid": nid});;
};
browseQueue = function (idx) {
var item = ctrl.queues[idx];
var nid = getQueuesNid(item, $location);
@ -224,16 +305,14 @@ var Artemis;
return targetNID;
}
function getRootNid($location) {
var currentNid = $location.search()['nid'];
Artemis.log.debug("current nid=" + currentNid);
var firstDash = currentNid.indexOf('-');
var secondDash = currentNid.indexOf('-', firstDash + 1);
var thirdDash = currentNid.indexOf('-', secondDash + 1);
if (thirdDash < 0) {
return currentNid + "-";
}
var rootNID = currentNid.substring(0, thirdDash + 1);
return rootNID;
var mBean = Artemis.getBrokerMBean(workspace, jolokia);
var details = Core.parseMBean(mBean);
var properties = details['attributes'];
var brokerAddress = properties["broker"] || "unknown";
var artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
//we have to remove the surrounding quotes
return "root-" + artemisJmxDomain + "-" + brokerAddress.replace(/^"|"$/g, '') + "-";
}
ctrl.loadOperation = function () {
if (mbean) {
@ -257,7 +336,7 @@ var Artemis;
ctrl.pagination.setOperation(ctrl.loadOperation);
function onError(response) {
Core.notification("error", "could not invoke list sessions" + response.error);
Core.notification("error", "could not invoke list queues" + response.error);
$scope.workspace.selectParentNode();
};

View File

@ -28,6 +28,7 @@ var Artemis;
</h1>
<div ng-include="'plugin/artemistoolbar.html'"></div>
<pf-table-view config="$ctrl.tableConfig"
dt-options="$ctrl.dtOptions"
columns="$ctrl.tableColumns"
action-buttons="$ctrl.tableActionButtons"
items="$ctrl.sessions">
@ -70,6 +71,7 @@ var Artemis;
function SessionsController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConnection, artemisSession, artemisConsumer, artemisProducer) {
var ctrl = this;
ctrl.pagination = pagination;
ctrl.pagination.reset();
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
ctrl.allSessions = [];
ctrl.sessions = [];
@ -79,16 +81,46 @@ var Artemis;
ctrl.sessionToDeletesConnection = '';
ctrl.sessionToDelete = '';
ctrl.closeDialog = false;
ctrl.dtOptions = {
// turn of ordering as we do it ourselves
ordering: false,
columns: [
{name: "ID", visible: true},
{name: "Connection", visible: true},
{name: "User", visible: true},
{name: "Consumer Count", visible: true},
{name: "Producer Count", visible: true},
{name: "Creation Time", visible: true}
]
};
Artemis.log.debug('localStorage: sessionsColumnDefs =', localStorage.getItem('sessionsColumnDefs'));
if (localStorage.getItem('sessionsColumnDefs')) {
loadedDefs = JSON.parse(localStorage.getItem('sessionsColumnDefs'));
//sanity check to make sure columns havent been added
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
ctrl.dtOptions.columns = loadedDefs;
}
}
ctrl.updateColumns = function () {
var attributes = [];
ctrl.dtOptions.columns.forEach(function (column) {
attributes.push({name: column.name, visible: column.visible});
});
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
localStorage.setItem('sessionsColumnDefs', JSON.stringify(attributes));
}
ctrl.filter = {
fieldOptions: [
{id: 'ID', name: 'ID'},
{id: 'CONNECTION_ID', name: 'Connection ID'},
{id: 'CONSUMER_COUNT', name: 'Consumer Count'},
{id: 'USER', name: 'User'},
{id: 'PROTOCOL', name: 'Protocol'},
{id: 'CLIENT_ID', name: 'Client ID'},
{id: 'LOCAL_ADDRESS', name: 'Local Address'},
{id: 'REMOTE_ADDRESS', name: 'Remote Address'}
{id: 'id', name: 'ID'},
{id: 'connection_id', name: 'Connection ID'},
{id: 'consumer_count', name: 'Consumer Count'},
{id: 'user', name: 'User'},
{id: 'protocol', name: 'Protocol'},
{id: 'client_id', name: 'Client ID'},
{id: 'local_address', name: 'Local Address'},
{id: 'remote_address', name: 'Remote Address'}
],
operationOptions: [
{id: 'EQUALS', name: 'Equals'},
@ -181,6 +213,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisConnection.connection.connectionID;
artemisConnection.connection = null;
}
if (artemisSession.session) {
@ -188,6 +221,7 @@ var Artemis;
ctrl.filter.values.field = ctrl.filter.fieldOptions[0].id;
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
ctrl.filter.values.value = artemisSession.session.session;
artemisSession.session = null;
}
function openCloseDialog(action, item) {

View File

@ -66,6 +66,41 @@ var Artemis;
ng-click="$ctrl.reset()">Reset
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-default primary-action ng-binding ng-scope"
type="button"
title=""
ng-click="$ctrl.showColumns = true">Columns
</button>
</div>
</div>
</div>
<div class="form-group" ng-show="$ctrl.showColumns">
<button class="btn btn-default" data-toggle="modal" data-target="#myModal">Columns</button>
<div class="modal ng-scope">
<div class="modal-dialog ">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title ng-binding">Column Selector</h4>
</div>
<div class="modal-body">
<table class="table-view-container table table-striped table-bordered table-hover dataTable ng-scope ng-isolate-scope no-footer">
<tbody>
<tr ng-repeat="col in $ctrl.dtOptions.columns">
<td>{{ col.name }}</td>
<td><input type="checkbox" ng-model="col.visible" placeholder="Name" autocomplete="off" id="name"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default ng-binding" ng-click="$ctrl.showColumns = false;$ctrl.updateColumns()">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>

View File

@ -703,6 +703,55 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
}
}
@Override
public String getLastValueKey() {
if (AuditLogger.isEnabled()) {
AuditLogger.lastValueKey(queue);
}
checkStarted();
clearIO();
try {
if (queue.getLastValueKey() != null) {
return queue.getLastValueKey().toString();
} else {
return null;
}
} finally {
blockOnIO();
}
}
@Override
public int getConsumersBeforeDispatch() {
if (AuditLogger.isEnabled()) {
AuditLogger.consumersBeforeDispatch(queue);
}
checkStarted();
clearIO();
try {
return queue.getConsumersBeforeDispatch();
} finally {
blockOnIO();
}
}
@Override
public long getDelayBeforeDispatch() {
if (AuditLogger.isEnabled()) {
AuditLogger.delayBeforeDispatch(queue);
}
checkStarted();
clearIO();
try {
return queue.getDelayBeforeDispatch();
} finally {
blockOnIO();
}
}
@Override
public Map<String, Object>[] listScheduledMessages() throws Exception {
if (AuditLogger.isEnabled()) {

View File

@ -60,14 +60,19 @@ public class QueueView extends ActiveMQAbstractView<QueueControl> {
.add("messagesAcked", toString(queue.getMessagesAcknowledged()))
.add("deliveringCount", toString(queue.getDeliveringCount()))
.add("messagesKilled", toString(queue.getMessagesKilled()))
.add("deliverDeliver", toString(q.isDirectDeliver()))
.add("directDeliver", toString(q.isDirectDeliver()))
.add("exclusive", toString(queue.isExclusive()))
.add("lastValue", toString(queue.isLastValue()))
.add("lastValueKey", toString(queue.getLastValueKey()))
.add("scheduledCount", toString(queue.getScheduledCount()))
.add("groupRebalance", toString(queue.isGroupRebalance()))
.add("groupRebalancePauseDispatch", toString(queue.isGroupRebalancePauseDispatch()))
.add("groupBuckets", toString(queue.getGroupBuckets()))
.add("groupFirstKey", toString(queue.getGroupFirstKey()));
.add("groupFirstKey", toString(queue.getGroupFirstKey()))
.add("enabled", toString(queue.isEnabled()))
.add("ringSize", toString(queue.getRingSize()))
.add("consumersBeforeDispatch", toString(queue.getConsumersBeforeDispatch()))
.add("delayBeforeDispatch", toString(queue.getDelayBeforeDispatch()));
return obj;
}
@ -119,6 +124,8 @@ public class QueueView extends ActiveMQAbstractView<QueueControl> {
return q.isExclusive();
case "lastValue":
return q.isLastValue();
case "lastValueKey":
return q.getLastValueKey();
case "scheduledCount":
return q.getScheduledCount();
case "groupRebalance":
@ -129,6 +136,14 @@ public class QueueView extends ActiveMQAbstractView<QueueControl> {
return queue.getGroupBuckets();
case "groupFirstKey":
return queue.getGroupFirstKey();
case "enabled":
return q.isEnabled();
case "ringSize":
return q.getRingSize();
case "consumersBeforeDispatch":
return q.getConsumersBeforeDispatch();
case "delayBeforeDispatch":
return q.getDelayBeforeDispatch();
default:
throw new IllegalArgumentException("Unsupported field, " + fieldName);
}

View File

@ -224,6 +224,21 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
return (Boolean) proxy.retrieveAttributeValue("lastValue");
}
@Override
public String getLastValueKey() {
return (String) proxy.retrieveAttributeValue("lastValueKey");
}
@Override
public int getConsumersBeforeDispatch() {
return (Integer) proxy.retrieveAttributeValue("consumersBeforeDispatch");
}
@Override
public long getDelayBeforeDispatch() {
return (Long) proxy.retrieveAttributeValue("delayBeforeDispatch");
}
@Override
public int getDeliveringCount() {
return (Integer) proxy.retrieveAttributeValue("deliveringCount", Integer.class);