From 19d06780b7d15bd68d7f451ede011adf40cbf381 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Mon, 11 Aug 2014 16:27:38 +0000 Subject: QPID-5987: [Java Broker] Make VHN/VH grid consistent with other grids on broker tab in web management console git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1617324 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/resources/js/qpid/management/Broker.js | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js index 8cc3e76b58..fd30446d2b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js @@ -339,7 +339,7 @@ define(["dojo/_base/xhr", var gridProperties = { height: 400, - selectionMode: "single", + selectionMode: "extended", plugins: { pagination: { pageSizes: [10, 25, 50, 100], @@ -373,20 +373,27 @@ define(["dojo/_base/xhr", formatter: function(item){ return item && item.virtualhosts? item.virtualhosts[0].type: "N/A"; } - }, - { name: "Connections", field: "_item", width: "10%", + }, + { name: "Connections", field: "_item", width: "8%", formatter: function(item){ - return item && item.virtualhosts? item.virtualhosts[0].statistics.connectionCount: 0; + return item && item.virtualhosts? item.virtualhosts[0].statistics.connectionCount: "N/A"; } }, - { name: "Queues", field: "_item", width: "10%", + { name: "Queues", field: "_item", width: "8%", formatter: function(item){ - return item && item.virtualhosts? item.virtualhosts[0].statistics.queueCount: 0; + return item && item.virtualhosts? item.virtualhosts[0].statistics.queueCount: "N/A"; } }, - { name: "Exchanges", field: "_item", width: "10%", + { name: "Exchanges", field: "_item", width: "8%", formatter: function(item){ - return item && item.virtualhosts? item.virtualhosts[0].statistics.exchangeCount: 0; + return item && item.virtualhosts? item.virtualhosts[0].statistics.exchangeCount: "N/A"; + } + }, + { + name: "Default", field: "_item", width: "6%", + formatter: function(item){ + var val = item && item.virtualhosts? item.virtualhosts[0].name: null; + return ""; } } ], function(obj) { @@ -424,6 +431,7 @@ define(["dojo/_base/xhr", if (data.length == 1) { that.showVirtualHost(data[0], brokerObj); + that.vhostsGrid.grid.selection.clear(); } }); @@ -434,6 +442,7 @@ define(["dojo/_base/xhr", { var item = data[0]; that.controller.show("virtualhostnode", item.name, brokerObj, item.id); + that.vhostsGrid.grid.selection.clear(); } } ); @@ -457,6 +466,7 @@ define(["dojo/_base/xhr", var item = data[0]; util.sendRequest("api/latest/virtualhostnode/" + encodeURIComponent(item.name), "PUT", {desiredState: "ACTIVE"}); + that.vhostsGrid.grid.selection.clear(); } }); @@ -473,6 +483,7 @@ define(["dojo/_base/xhr", { util.sendRequest("api/latest/virtualhostnode/" + encodeURIComponent(item.name), "PUT", {desiredState: "STOPPED"}); + that.vhostsGrid.grid.selection.clear(); } } }); @@ -486,6 +497,7 @@ define(["dojo/_base/xhr", var host = item.virtualhosts[0]; util.sendRequest("api/latest/virtualhost/" + encodeURIComponent(item.name) + "/" + encodeURIComponent(host.name), "PUT", {desiredState: "ACTIVE"}); + that.vhostsGrid.grid.selection.clear(); } }); @@ -501,12 +513,11 @@ define(["dojo/_base/xhr", { util.sendRequest("api/latest/virtualhost/" + encodeURIComponent(item.name) + "/" + encodeURIComponent(host.name), "PUT", {desiredState: "STOPPED"}); + that.vhostsGrid.grid.selection.clear(); } } }); - gridProperties.selectionMode="extended"; - that.portsGrid = new UpdatableStore(that.brokerData.ports, query(".broker-ports")[0], [ { name: "Name", field: "name", width: "15%"}, -- cgit v1.2.1