in broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js [337:696]
function Updater(virtualHost)
{
var vhost = virtualHost.modelObj;
var controller = virtualHost.controller;
var node = virtualHost.contentPane.containerNode;
this.tabObject = virtualHost;
this.contentPane = virtualHost.contentPane;
this.management = controller.management;
this.modelObj = vhost;
this.vhostData = {};
var that = this;
function findNode(name)
{
return query("." + name, node)[0];
}
function storeNodes(names)
{
for (var i = 0; i < names.length; i++)
{
that[names[i]] = findNode(names[i]);
}
}
this.virtualhostStatisticsNode = findNode("virtualhostStatistics");
storeNodes(["name",
"type",
"state",
"durable",
"lifetimePolicy",
"virtualHostDetailsContainer",
"connectionThreadPoolSize",
"statisticsReportingPeriod",
"housekeepingCheckPeriod",
"housekeepingThreadCount",
"storeTransactionIdleTimeoutClose",
"storeTransactionIdleTimeoutWarn",
"storeTransactionOpenTimeoutClose",
"storeTransactionOpenTimeoutWarn",
"virtualHostConnections",
"virtualHostChildren"]);
var CustomGrid = declare([QueryGrid, Selector]);
this.queuesGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: util.queryResultToObjects,
management: this.management,
parentObject: this.modelObj,
category: "Queue",
selectClause: "id, name, type, consumerCount, queueDepthMessages, queueDepthBytes",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "Type",
field: "type"
}, {
label: "Consumers",
field: "consumerCount"
}, {
label: "Depth (msgs)",
field: "queueDepthMessages"
}, {
label: "Depth (bytes)",
field: "queueDepthBytes",
formatter: function (value, object)
{
var bytesFormat = formatter.formatBytes(value);
return bytesFormat.toString();
}
}
]
}, findNode("queues"));
this.queuesGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.queuesGrid.startup();
this.exchangesGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: util.queryResultToObjects,
management: this.management,
parentObject: this.modelObj,
category: "Exchange",
selectClause: "id, name, type, bindingCount",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
allowSelect: function (row)
{
var item = row.data;
var isStandard = item && item.name && util.isReservedExchangeName(item.name);
return !isStandard;
},
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "Type",
field: "type"
}, {
label: "Binding Count",
field: "bindingCount"
}
]
}, findNode("exchanges"));
this.exchangesGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.exchangesGrid.startup();
this.connectionsGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: lang.hitch(this, this._transformConnectionData),
management: this.management,
parentObject: this.modelObj,
category: "Connection",
selectClause: "id, name, principal, port.name AS port, transport, sessionCount, messagesIn, bytesIn, messagesOut, bytesOut",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "User",
field: "principal"
}, {
label: "Port",
field: "port"
}, {
label: "Transport",
field: "transport"
}, {
label: "Sessions",
field: "sessionCount"
}, {
label: "Msgs In",
field: "msgInRate"
}, {
label: "Bytes In",
field: "bytesInRate"
}, {
label: "Msgs Out",
field: "msgOutRate"
}, {
label: "Bytes Out",
field: "bytesOutRate"
}
]
}, findNode("connections"));
this.connectionsGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.connectionsGrid.startup();
this.virtualHostLoggersGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: util.queryResultToObjects,
management: this.management,
parentObject: this.modelObj,
category: "VirtualHostLogger",
selectClause: "id, name, type, errorCount, warnCount",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "Type",
field: "type"
}, {
label: "Errors",
field: "errorCount"
}, {
label: "Warnings",
field: "warnCount"
}
]
}, findNode("loggers"));
this.virtualHostLoggersGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.virtualHostLoggersGrid.startup();
var Store = MemoryStore.createSubclass(TrackableStore);
this._policyStore = new Store({
data: [],
idProperty: "pattern"
});
var PolicyGrid = declare([Grid, Keyboard, Selection, Pagination, ColumnResizer, DijitRegistry]);
this._policyGrid = new PolicyGrid({
rowsPerPage: 10,
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
cellNavigation: true,
className: 'dgrid-autoheight',
pageSizeOptions: [10, 20, 30, 40, 50, 100],
adjustLastColumn: true,
collection: this._policyStore,
highlightRow: function () {
},
columns: [
{
label: 'Node Type',
field: "nodeType"
}, {
label: "Pattern",
field: "pattern"
}, {
label: "Create On Publish",
field: "createdOnPublish",
selector: 'checkbox'
}, {
label: "Create On Consume",
field: "createdOnConsume",
selector: 'checkbox'
}, {
label: "Attributes",
field: "attributes",
sortable: false,
formatter: function (value, object)
{
var markup = "";
if (value)
{
markup = "<div class='keyValuePair'>";
for (var key in value)
{
markup += "<div>" + entities.encode(String(key)) + "="
+ entities.encode(String(value[key])) + "</div>";
}
markup += "</div>"
}
return markup;
}
}
]
}, findNode("policies"));
this._policyGrid.startup();
this._nodeAutoCreationPolicies = registry.byNode(findNode("nodeAutoCreationPolicies"));
aspect.after(this._nodeAutoCreationPolicies, "toggle", lang.hitch(this, function () {
if (this._nodeAutoCreationPolicies.get("open") === true)
{
this._policyGrid.refresh();
}
}));
this.virtualHostAccessControlProviderGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: util.queryResultToObjects,
management: this.management,
parentObject: this.modelObj,
category: "VirtualHostAccessControlProvider",
selectClause: "id, name, state, type, priority",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "State",
field: "state"
}, {
label: "Type",
field: "type"
}, {
label: "Priority",
field: "priority"
}
]
}, findNode("virtualHostAccessControlProviders"));
this.virtualHostAccessControlProviderGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.virtualHostAccessControlProviderGrid.startup();
this.virtualHostConnectionLimitProviderGrid = new CustomGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: util.queryResultToObjects,
management: this.management,
parentObject: this.modelObj,
category: "VirtualHostConnectionLimitProvider",
selectClause: "id, name, state, type",
orderBy: "name",
selectionMode: 'none',
deselectOnRefresh: false,
allowSelectAll: true,
columns: [
{
field: "selected",
label: 'All',
selector: 'checkbox'
}, {
label: "Name",
field: "name"
}, {
label: "State",
field: "state"
}, {
label: "Type",
field: "type"
}
]
}, findNode("virtualHostConnectionLimitProviders"));
this.virtualHostConnectionLimitProviderGrid.on('rowBrowsed', function (event) {
controller.showById(event.id);
});
this.virtualHostConnectionLimitProviderGrid.startup();
}