From commits-return-43818-apmail-qpid-commits-archive=qpid.apache.org@qpid.apache.org Tue Feb 20 13:25:41 2018 Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F13B1183F0 for ; Tue, 20 Feb 2018 13:25:41 +0000 (UTC) Received: (qmail 96695 invoked by uid 500); 20 Feb 2018 13:25:41 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 96663 invoked by uid 500); 20 Feb 2018 13:25:41 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 96654 invoked by uid 99); 20 Feb 2018 13:25:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2018 13:25:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C1CD7DFC3E; Tue, 20 Feb 2018 13:25:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kwall@apache.org To: commits@qpid.apache.org Message-Id: <643242b0ca494e2d8d51bffb4516d2bb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-broker-j git commit: QPID-8101: [Broker-J] [WMC] Add ability to close more than one connection at once Date: Tue, 20 Feb 2018 13:25:40 +0000 (UTC) Repository: qpid-broker-j Updated Branches: refs/heads/master 2303a76e2 -> fbca8f16e QPID-8101: [Broker-J] [WMC] Add ability to close more than one connection at once Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/fbca8f16 Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/fbca8f16 Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/fbca8f16 Branch: refs/heads/master Commit: fbca8f16e36d84fc0fc3291ca9937b31ed8a73a4 Parents: 2303a76 Author: Keith Wall Authored: Tue Feb 20 12:33:29 2018 +0000 Committer: Keith Wall Committed: Tue Feb 20 13:24:20 2018 +0000 ---------------------------------------------------------------------- .../src/main/java/resources/css/common.css | 3 +- .../resources/js/qpid/management/VirtualHost.js | 52 +++++++++++++------- .../main/java/resources/showVirtualHost.html | 1 + 3 files changed, 38 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/fbca8f16/broker-plugins/management-http/src/main/java/resources/css/common.css ---------------------------------------------------------------------- diff --git a/broker-plugins/management-http/src/main/java/resources/css/common.css b/broker-plugins/management-http/src/main/java/resources/css/common.css index bc92699..cac53f6 100644 --- a/broker-plugins/management-http/src/main/java/resources/css/common.css +++ b/broker-plugins/management-http/src/main/java/resources/css/common.css @@ -522,7 +522,8 @@ td.advancedSearchField, col.autoWidth { .claro.qpid .dgrid-header .dgrid-cell { font-weight: normal; } -.virtualHostConnections .field-name { width: 20%; } +.virtualHostConnections .field-selected { width: 2em; } +.virtualHostConnections .field-name { width: auto; } .virtualHostConnections .field-principal { width: 10% } .virtualHostConnections .field-port { width: 10% } .virtualHostConnections .field-transport { width: 10% } http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/fbca8f16/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js ---------------------------------------------------------------------- diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js index 11fc134..dd7a2fc 100644 --- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js +++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js @@ -89,7 +89,9 @@ define(["dojo/parser", var deleteQueueButton = query(".deleteQueueButton", containerNode)[0]; registry.byNode(deleteQueueButton).on("click", function (evt) { - that._deleteSelectedItems(that.vhostUpdater.queuesGrid, "queue", "queue"); + that._deleteSelectedItems(that.vhostUpdater.queuesGrid, + {type: "queue", parent: this.modelObj}, + "delete", "queue"); }); var addExchangeButton = query(".addExchangeButton", containerNode)[0]; @@ -101,7 +103,17 @@ define(["dojo/parser", var deleteExchangeButton = query(".deleteExchangeButton", containerNode)[0]; registry.byNode(deleteExchangeButton).on("click", function (evt) { - that._deleteSelectedItems(that.vhostUpdater.exchangesGrid, "exchange", "exchange"); + that._deleteSelectedItems(that.vhostUpdater.exchangesGrid, + {type: "exchange", parent: that.modelObj}, + "delete", "exchange"); + }); + + var closeConnectionButton = query(".closeConnectionButton", containerNode)[0]; + registry.byNode(closeConnectionButton).on("click", function (evt) + { + that._deleteSelectedItems(that.vhostUpdater.connectionsGrid, + {type: "connection"}, + "close", "connection"); }); var addLoggerButtonNode = query(".addVirtualHostLogger", contentPane.containerNode)[0]; @@ -115,7 +127,9 @@ define(["dojo/parser", var deleteLoggerButton = registry.byNode(deleteLoggerButtonNode); deleteLoggerButton.on("click", function (evt) { - that._deleteSelectedItems(that.vhostUpdater.virtualHostLoggersGrid, "virtualhostlogger", "virtual host logger"); + that._deleteSelectedItems(that.vhostUpdater.virtualHostLoggersGrid, + {type: "virtualhostlogger", parent: that.modelObj}, + "delete", "virtual host logger"); }); that.stopButton = registry.byNode(query(".stopButton", containerNode)[0]); @@ -175,7 +189,7 @@ define(["dojo/parser", }); }; - VirtualHost.prototype._deleteSelectedItems = function(dgrid, category, friendlyCategoryName) + VirtualHost.prototype._deleteSelectedItems = function (dgrid, modelObj, friendlyAction, friendlyCategoryName) { var selected = []; var selection = dgrid.selection; @@ -188,18 +202,15 @@ define(["dojo/parser", } if (selected.length > 0) { - var ending = selected.length > 1 ? "s " : " "; - if (confirm(lang.replace("Are you sure you want to delete {0} {1}{2}from virtual host '{3}'?", - [selected.length, - entities.encode(String(friendlyCategoryName || category )), - ending, - entities.encode(String(this.modelObj.name))]))) + var plural = selected.length === 1 ? "" : "s"; + if (confirm(lang.replace("Are you sure you want to {0} {1} {2}{3}?", + [friendlyAction, + selected.length, + entities.encode(friendlyCategoryName), + plural]))) { this.management - .remove({ - type: category, - parent: this.modelObj - }, {"id": selected}) + .remove(modelObj, {"id": selected}) .then(lang.hitch(this, function (responseData) { dgrid.clearSelection(); @@ -352,17 +363,24 @@ define(["dojo/parser", this.exchangesGrid.on('rowBrowsed', function(event){controller.showById(event.id);}); this.exchangesGrid.startup(); - this.connectionsGrid = new QueryGrid({ + this.connectionsGrid = new CustomGrid({ detectChanges: true, rowsPerPage: 10, - selectionMode: 'none', 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", - columns: [{ + selectionMode: 'none', + deselectOnRefresh: false, + allowSelectAll: true, + columns: [ + { + field: "selected", + label: 'All', + selector: 'checkbox' + }, { label: "Name", field: "name" }, { http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/fbca8f16/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html ---------------------------------------------------------------------- diff --git a/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html b/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html index 8ae1a69..9be2a60 100644 --- a/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html +++ b/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html @@ -125,6 +125,7 @@
+

--------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org