From 030cdc4d9af7a906cf3939c49d68d96a5f12bb68 Mon Sep 17 00:00:00 2001 From: Michael Andre Pearce Date: Wed, 23 Aug 2017 21:09:23 +0100 Subject: [PATCH] ARTEMIS-1350 - Update management console to expose client side objects Fix for close button, being shown on selection and hidden on reset/unselect. --- .../src/main/webapp/plugin/html/connections.html | 4 ++-- .../src/main/webapp/plugin/html/consumers.html | 4 ++-- .../src/main/webapp/plugin/html/sessions.html | 4 ++-- .../src/main/webapp/plugin/js/connections.js | 5 +++++ .../artemis-plugin/src/main/webapp/plugin/js/consumers.js | 8 ++++++-- .../artemis-plugin/src/main/webapp/plugin/js/sessions.js | 6 +++++- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html index 9b3b231b80..d9539f88f4 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html @@ -45,7 +45,7 @@
-
-
+
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html index 32589260f2..64de3b2ceb 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html @@ -47,7 +47,7 @@
-
-
+
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html index 0e03bc4d78..0144e50628 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html @@ -45,7 +45,7 @@
-
-
+
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js index 170af8a42e..b24dba8946 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js @@ -143,6 +143,7 @@ var ARTEMIS = (function(ARTEMIS) { directions: ["asc"] }; var refreshed = false; + $scope.showClose = false; $scope.gridOptions = { selectedItems: [], data: 'objects', @@ -187,11 +188,15 @@ var ARTEMIS = (function(ARTEMIS) { jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); } }; + $scope.selectGridRow = function () { + $scope.showClose = $scope.gridOptions.selectedItems.length > 0; + }; function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } function populateTable(response) { $scope.gridOptions.selectedItems.length = 0; + $scope.showClose = false; var data = JSON.parse(response.value); $scope.objects = []; angular.forEach(data["data"], function (value, idx) { diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js index 25e206a1bc..799683b096 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js @@ -170,7 +170,7 @@ var ARTEMIS = (function(ARTEMIS) { directions: ["asc"] }; var refreshed = false; - + $scope.showClose = false; $scope.gridOptions = { selectedItems: [], data: 'objects', @@ -215,11 +215,15 @@ var ARTEMIS = (function(ARTEMIS) { jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); } }; + $scope.selectGridRow = function () { + $scope.showClose = $scope.gridOptions.selectedItems.length > 0; + }; function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } function populateTable(response) { - $scope.gridOptions.selectedItems.length = 0; + $scope.gridOptions.selectedItems.length = 0; + $scope.showClose = false; var data = JSON.parse(response.value); $scope.objects = []; angular.forEach(data["data"], function (value, idx) { diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js index ce661a10f1..498f10ea73 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js @@ -163,7 +163,7 @@ var ARTEMIS = (function(ARTEMIS) { directions: ["asc"] }; var refreshed = false; - + $scope.showClose = false; $scope.gridOptions = { selectedItems: [], data: 'objects', @@ -208,11 +208,15 @@ var ARTEMIS = (function(ARTEMIS) { jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); } }; + $scope.selectGridRow = function () { + $scope.showClose = $scope.gridOptions.selectedItems.length > 0; + }; function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } function populateTable(response) { $scope.gridOptions.selectedItems.length = 0; + $scope.showClose = false; var data = JSON.parse(response.value); $scope.objects = []; angular.forEach(data["data"], function (value, idx) {