Repository: activemq-artemis Updated Branches: refs/heads/master 1efb4b97e -> 8296b3b56
ARTEMIS-1603 fixed browsing tables under JMX tab Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c5c3a43d Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c5c3a43d Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c5c3a43d Branch: refs/heads/master Commit: c5c3a43d4c10634677bad049959348fa7009eb1a Parents: 1efb4b9 Author: Stanislav Knot <sk...@redhat.com> Authored: Thu Feb 1 16:18:11 2018 +0100 Committer: Michael Andre Pearce <michael.andre.pea...@me.com> Committed: Thu Feb 22 20:34:15 2018 +0000 ---------------------------------------------------------------------- .../src/main/webapp/plugin/js/addresses.js | 7 +- .../src/main/webapp/plugin/js/artemisPlugin.js | 143 +++++++++++-------- .../src/main/webapp/plugin/js/connections.js | 7 +- .../src/main/webapp/plugin/js/consumers.js | 7 +- .../src/main/webapp/plugin/js/producers.js | 7 +- .../src/main/webapp/plugin/js/queues.js | 7 +- .../src/main/webapp/plugin/js/sessions.js | 7 +- 7 files changed, 116 insertions(+), 69 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js ---------------------------------------------------------------------- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js index c321acb..67867b5 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js @@ -155,7 +155,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -164,6 +166,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { var data = JSON.parse(response.value); $scope.objects = []; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisPlugin.js ---------------------------------------------------------------------- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisPlugin.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisPlugin.js index d6acc3c..72c881f 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisPlugin.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisPlugin.js @@ -94,7 +94,7 @@ var ARTEMIS = (function(ARTEMIS) { templateUrl: ARTEMIS.templatePath + 'createAddress.html' }) .when('/artemis/deleteAddress', { - templateUrl: ARTEMIS.templatePath + 'deleteAddress.html' + templateUrl: ARTEMIS.templatePath + 'deleteAddress.html' }) .when('/artemis/deleteQueue', { templateUrl: ARTEMIS.templatePath + 'deleteQueue.html' @@ -114,21 +114,39 @@ var ARTEMIS = (function(ARTEMIS) { .when('/artemis/connections', { templateUrl: ARTEMIS.templatePath + 'connections.html' }) + .when('/jmx/connections', { + templateUrl: ARTEMIS.templatePath + 'connections.html' + }) .when('/artemis/sessions', { templateUrl: ARTEMIS.templatePath + 'sessions.html' }) + .when('/jmx/sessions', { + templateUrl: ARTEMIS.templatePath + 'sessions.html' + }) .when('/artemis/consumers', { - templateUrl: ARTEMIS.templatePath + 'consumers.html' + templateUrl: ARTEMIS.templatePath + 'consumers.html' + }) + .when('/jmx/consumers', { + templateUrl: ARTEMIS.templatePath + 'consumers.html' }) .when('/artemis/producers', { - templateUrl: ARTEMIS.templatePath + 'producers.html' + templateUrl: ARTEMIS.templatePath + 'producers.html' + }) + .when('/jmx/producers', { + templateUrl: ARTEMIS.templatePath + 'producers.html' }) - .when('/artemis/addresses', { + .when('/artemis/addresses', { templateUrl: ARTEMIS.templatePath + 'addresses.html' }) - .when('/artemis/queues', { + .when('/jmx/addresses', { + templateUrl: ARTEMIS.templatePath + 'addresses.html' + }) + .when('/artemis/queues', { + templateUrl: ARTEMIS.templatePath + 'queues.html' + }) + .when('/jmx/queues', { templateUrl: ARTEMIS.templatePath + 'queues.html' - }); + }); }); ARTEMIS.module.factory('artemisMessage', function () { @@ -243,66 +261,65 @@ var ARTEMIS = (function(ARTEMIS) { }); workspace.subLevelTabs.push({ - content: '<i class="icon-pencil"></i> Send', - title: "Send a message to this address", - isValid: function (workspace) { return isAddress(workspace, artemisJmxDomain) || isQueue(workspace, artemisJmxDomain); }, - href: function () { return "#/artemis/sendMessage"; } + content: '<i class="icon-pencil"></i> Send', + title: "Send a message to this address", + isValid: function (workspace) { return isAddress(workspace, artemisJmxDomain) || isQueue(workspace, artemisJmxDomain); }, + href: function () { return "#/artemis/sendMessage"; } }); - workspace.subLevelTabs.unshift({ - content: '<i class="icon-picture"></i> Diagram |', - title: "View a diagram of the producers, destinations and consumers", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/diagram"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-th-list"></i> Queues', - title: "Manage Queues", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/queues"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-book"></i> Addresses', - title: "Manage Addresses", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/addresses"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-upload-alt"></i> Producers', - title: "Manage Producers", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/producers"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-download-alt"></i> Consumers', - title: "Manage Consumers", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/consumers"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-tasks"></i> Sessions', - title: "Manage Sessions", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/sessions"; } - }); - - workspace.subLevelTabs.unshift({ - content: '<i class="icon-signal"></i> Connections', - title: "Manage Connections", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/connections"; } - }); - - preLogoutTasks.addTask("clearArtemisCredentials", () => { - localStorage.removeItem('artemisUserName'); - localStorage.removeItem('artemisPassword'); - }); + workspace.subLevelTabs.unshift({ + content: '<i class="icon-picture"></i> Diagram |', + title: "View a diagram of the producers, destinations and consumers", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { return "#/artemis/diagram"; } + }); + workspace.subLevelTabs.unshift({ + content: '<i class="icon-th-list"></i> Queues', + title: "Manage Queues", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/queues"; else return "#/jmx/queues"; } + }); + + workspace.subLevelTabs.unshift({ + content: '<i class="icon-book"></i> Addresses', + title: "Manage Addresses", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/addresses"; else return "#/jmx/addresses"; } + }); + + workspace.subLevelTabs.unshift({ + content: '<i class="icon-upload-alt"></i> Producers', + title: "Manage Producers", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/producers"; else return "#/jmx/producers"; } + }); + + workspace.subLevelTabs.unshift({ + content: '<i class="icon-download-alt"></i> Consumers', + title: "Manage Consumers", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/consumers"; else return "#/jmx/consumers"; } + }); + + workspace.subLevelTabs.unshift({ + content: '<i class="icon-tasks"></i> Sessions', + title: "Manage Sessions", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/sessions"; else return "#/jmx/sessions"; } + }); + + workspace.subLevelTabs.unshift({ + content: '<i class="icon-signal"></i> Connections', + title: "Manage Connections", + isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, + href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/connections"; else return "#/jmx/connections"; } + }); + + preLogoutTasks.addTask("clearArtemisCredentials", () => { + localStorage.removeItem('artemisUserName'); + localStorage.removeItem('artemisPassword'); + }); }); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js ---------------------------------------------------------------------- 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 a63d581..cde8082 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 @@ -187,7 +187,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -199,6 +201,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { $scope.gridOptions.selectedItems.length = 0; $scope.showClose = false; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js ---------------------------------------------------------------------- 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 8273676..00a1c76 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 @@ -211,7 +211,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -223,6 +225,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { $scope.gridOptions.selectedItems.length = 0; $scope.showClose = false; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js ---------------------------------------------------------------------- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js index 4f30376..ce198ff 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js @@ -181,7 +181,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -190,6 +192,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { var data = JSON.parse(response.value); $scope.objects = []; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js ---------------------------------------------------------------------- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js index 204b12d..9a4e994 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js @@ -255,7 +255,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -264,6 +266,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { var data = JSON.parse(response.value); $scope.objects = []; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5c3a43d/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js ---------------------------------------------------------------------- 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 199f1d6..9a92ef1 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 @@ -206,7 +206,9 @@ var ARTEMIS = (function(ARTEMIS) { $scope.filter.values.sortBy = $scope.sortOptions.directions[0]; $scope.filter.values.sortOrder = $scope.sortOptions.directions[0]; var mbean = getBrokerMBean(jolokia); - if (mbean) { + if (mbean.includes("undefined")) { + onBadMBean(); + } else if (mbean) { var filter = JSON.stringify($scope.filter.values); console.log("Filter string: " + filter); jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [filter, $scope.pagingOptions.currentPage, $scope.pagingOptions.pageSize] }, onSuccess(populateTable, { error: onError })); @@ -218,6 +220,9 @@ var ARTEMIS = (function(ARTEMIS) { function onError() { Core.notification("error", "Could not retrieve " + objectType + " list from Artemis."); } + function onBadMBean() { + Core.notification("error", "Could not retrieve " + objectType + " list. Wrong MBean selected."); + } function populateTable(response) { $scope.gridOptions.selectedItems.length = 0; $scope.showClose = false;