ARTEMIS-3398 - fix filtering in console with filter

https://issues.apache.org/jira/browse/ARTEMIS-3398
This commit is contained in:
Andy Taylor 2021-07-22 12:11:14 +01:00 committed by clebertsuconic
parent 51801d978e
commit 82e40ce229
2 changed files with 13 additions and 4 deletions

View File

@ -507,12 +507,14 @@ var Artemis;
ctrl.refresh = function() {
Artemis.log.debug(ctrl.filter)
ctrl.pagination.load();
//if refreshing always return to the first page
ctrl.pagination.firstPage();
}
ctrl.reset = function() {
ctrl.filter = '';
ctrl.pagination.load();
//if resetting always return to the first page
ctrl.pagination.firstPage();
}
function formatPersistentSize(bytes) {
@ -832,7 +834,13 @@ var Artemis;
} else {
onDlq(false);
}
jolokia.request({ type: 'exec', mbean: objName, operation: 'countMessages()'}, Core.onSuccess(function(response) { ctrl.pagination.page(response.value); }));
//make sure to count only filtered messages
if (ctrl.filter) {
jolokia.request({ type: 'exec', mbean: objName, operation: 'countMessages(java.lang.String)', arguments: [ctrl.filter] }, Core.onSuccess(function(response) { ctrl.pagination.page(response.value); }));
} else {
jolokia.request({ type: 'exec', mbean: objName, operation: 'countMessages()'}, Core.onSuccess(function(response) { ctrl.pagination.page(response.value); }));
}
jolokia.request({ type: 'exec', mbean: objName, operation: 'browse(int, int, java.lang.String)', arguments: [ctrl.pagination.pageNumber, ctrl.pagination.pageSize, ctrl.filter] }, Core.onSuccess(populateTable));
}
}

View File

@ -1574,8 +1574,9 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
if (index >= start) {
c.add(OpenTypeSupport.convert(ref, attributeSizeLimit));
}
//we only increase the index if we add a message, otherwise we could stop before we get to a filtered message
index++;
}
index++;
}
} catch (NoSuchElementException ignored) {
// this could happen through paging browsing