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 c321acb93a..67867b5b68 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 = []; 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 d6acc3c72b..72c881f1b3 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('/artemis/addresses', { + .when('/jmx/producers', { + templateUrl: ARTEMIS.templatePath + 'producers.html' + }) + .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: ' Send', - title: "Send a message to this address", - isValid: function (workspace) { return isAddress(workspace, artemisJmxDomain) || isQueue(workspace, artemisJmxDomain); }, - href: function () { return "#/artemis/sendMessage"; } + content: ' 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: ' 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: ' 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: ' Queues', - title: "Manage Queues", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/queues"; } - }); + workspace.subLevelTabs.unshift({ + content: ' 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: ' Addresses', - title: "Manage Addresses", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/addresses"; } - }); + workspace.subLevelTabs.unshift({ + content: ' 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: ' Producers', - title: "Manage Producers", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/producers"; } - }); + workspace.subLevelTabs.unshift({ + content: ' 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: ' Consumers', - title: "Manage Consumers", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/consumers"; } - }); + workspace.subLevelTabs.unshift({ + content: ' 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: ' Sessions', - title: "Manage Sessions", - isValid: function (workspace) { return workspace.isTopTabActive("artemis") || workspace.selectionHasDomain(artemisJmxDomain); }, - href: function () { return "#/artemis/sessions"; } - }); + workspace.subLevelTabs.unshift({ + content: ' 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: ' 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: ' 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'); + }); }); 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 a63d58187a..cde8082fc6 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; 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 8273676aa2..00a1c76d61 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; 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 4f3037640d..ce198ff68c 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 = []; 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 204b12d87d..9a4e994bc4 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 = []; 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 199f1d6387..9a92ef1a26 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;