ARTEMIS-1603 fixed browsing tables under JMX tab

This commit is contained in:
Stanislav Knot 2018-02-01 16:18:11 +01:00 committed by Michael Andre Pearce
parent 1efb4b97eb
commit c5c3a43d4c
7 changed files with 110 additions and 63 deletions

View File

@ -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 = [];

View File

@ -114,20 +114,38 @@ 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'
})
.when('/jmx/consumers', {
templateUrl: ARTEMIS.templatePath + 'consumers.html'
})
.when('/artemis/producers', {
templateUrl: ARTEMIS.templatePath + 'producers.html'
})
.when('/jmx/producers', {
templateUrl: ARTEMIS.templatePath + 'producers.html'
})
.when('/artemis/addresses', {
templateUrl: ARTEMIS.templatePath + 'addresses.html'
})
.when('/jmx/addresses', {
templateUrl: ARTEMIS.templatePath + 'addresses.html'
})
.when('/artemis/queues', {
templateUrl: ARTEMIS.templatePath + 'queues.html'
})
.when('/jmx/queues', {
templateUrl: ARTEMIS.templatePath + 'queues.html'
});
});
@ -260,49 +278,48 @@ var ARTEMIS = (function(ARTEMIS) {
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"; }
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 () { return "#/artemis/addresses"; }
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 () { return "#/artemis/producers"; }
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 () { return "#/artemis/consumers"; }
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 () { return "#/artemis/sessions"; }
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 () { return "#/artemis/connections"; }
href: function () { if (workspace.isTopTabActive("artemis")) return "#/artemis/connections"; else return "#/jmx/connections"; }
});
preLogoutTasks.addTask("clearArtemisCredentials", () => {
localStorage.removeItem('artemisUserName');
localStorage.removeItem('artemisPassword');
});
});

View File

@ -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;

View File

@ -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;

View File

@ -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 = [];

View File

@ -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 = [];

View File

@ -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;