From 2b5ca1be92bca957fde493e6f342750fa34a771d Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Fri, 23 Jul 2021 22:42:14 -0500 Subject: [PATCH] ARTEMIS-3401 use regex on web console for DLQ & expiry Currently dead-letter and expiry addresses can only be identified on the web console if they perfectly match a configurable string value (i.e. "DLQ" and "ExpiryQueue" by default respectively). However, lots of users have multiple dead-letter and expiry addresses which follow the same naming pattern. The web console should support using a regular expression so all of these addresses can be properly identified. --- .../src/main/webapp/plugin/html/preferences.html | 8 ++++---- .../src/main/webapp/plugin/js/components/browse.js | 12 ++++++------ .../main/webapp/plugin/js/components/preferences.js | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html index c619263e98..8227bba7c0 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html @@ -39,8 +39,8 @@
@@ -49,8 +49,8 @@
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js index 86a5dadf6e..e3442bbca6 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js @@ -218,13 +218,13 @@ var Artemis; var node = workspace.keyToNodeMap[key]; objName = node.objectName; } - var artemisDLQ = localStorage['artemisDLQ'] || "DLQ"; - var artemisExpiryQueue = localStorage['artemisExpiryQueue'] || "ExpiryQueue"; + var artemisDLQ = localStorage['artemisDLQ'] || "^DLQ$"; + var artemisExpiryQueue = localStorage['artemisExpiryQueue'] || "^ExpiryQueue$"; Artemis.log.debug("loading table" + artemisExpiryQueue); if (objName) { ctrl.dlq = false; var addressName = jolokia.getAttribute(objName, "Address"); - if (addressName == artemisDLQ || addressName == artemisExpiryQueue) { + if (addressName.match(artemisDLQ) != null || addressName.match(artemisExpiryQueue) != null) { ctrl.dlq = true; } } @@ -826,10 +826,10 @@ var Artemis; if (objName) { ctrl.dlq = false; var addressName = jolokia.getAttribute(objName, "Address"); - var artemisDLQ = localStorage['artemisDLQ'] || "DLQ"; - var artemisExpiryQueue = localStorage['artemisExpiryQueue'] || "ExpiryQueue"; + var artemisDLQ = localStorage['artemisDLQ'] || "^DLQ$"; + var artemisExpiryQueue = localStorage['artemisExpiryQueue'] || "^ExpiryQueue$"; Artemis.log.debug("loading table" + artemisExpiryQueue); - if (addressName == artemisDLQ || addressName == artemisExpiryQueue) { + if (addressName.match(artemisDLQ) != null || addressName.match(artemisExpiryQueue) != null) { onDlq(true); } else { onDlq(false); diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/preferences.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/preferences.js index 2c0dfb19c8..3ac856c71f 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/preferences.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/preferences.js @@ -26,10 +26,10 @@ var Artemis; 'value': userDetails.password ? userDetails.password : "" }, 'artemisDLQ': { - 'value': "DLQ" + 'value': "^DLQ$" }, 'artemisExpiryQueue': { - 'value': "ExpiryQueue" + 'value': "^ExpiryQueue$" }, 'ArtemisBrowseBytesMessages': { 'value': 99, @@ -71,8 +71,8 @@ var Artemis;
@@ -81,8 +81,8 @@ var Artemis;