This is an automated email from the ASF dual-hosted git repository.
tigerlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 1aad0cd front js check is v5 'false' will be true fix (#269)
1aad0cd is described below
commit 1aad0cda25b2627ebe7354436cc6e32da0cf2df7
Author: iamgd67 <[email protected]>
AuthorDate: Fri Mar 14 10:50:31 2025 +0800
front js check is v5 'false' will be true fix (#269)
---
src/main/resources/static/src/consumer.js | 2 +-
src/main/resources/static/src/controller.js | 9 +++++++++
src/main/resources/static/src/topic.js | 10 +++++-----
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/static/src/consumer.js
b/src/main/resources/static/src/consumer.js
index d192334..8cf845b 100644
--- a/src/main/resources/static/src/consumer.js
+++ b/src/main/resources/static/src/consumer.js
@@ -79,7 +79,7 @@ module.controller('consumerController', ['$scope',
'ngDialog', '$http', 'Notific
url: "consumer/groupList.query",
params: {
skipSysGroup: false,
- address: localStorage.getItem('isV5') ?
localStorage.getItem('proxyAddr') : null
+ address: $scope.isRmqVersionV5() ?
localStorage.getItem('proxyAddr') : null
}
}).success(function (resp) {
if (resp.status == 0) {
diff --git a/src/main/resources/static/src/controller.js
b/src/main/resources/static/src/controller.js
index 1d71c67..c2434c7 100644
--- a/src/main/resources/static/src/controller.js
+++ b/src/main/resources/static/src/controller.js
@@ -27,6 +27,15 @@ app.controller('AppCtrl',
['$scope','$window','$translate','$http','Notification
localStorage.setItem("isV5", v);
}
+ $scope.isRmqVersionV5 = function(){
+ var v=localStorage.getItem('isV5');
+ //for js !! 'false' is true!
+ if( /false/i.test(v) ){
+ return false;
+ }
+ return !! v;
+ }
+
$scope.logout = function(){
$http({
method: "POST",
diff --git a/src/main/resources/static/src/topic.js
b/src/main/resources/static/src/topic.js
index 81383b3..7ad997c 100644
--- a/src/main/resources/static/src/topic.js
+++ b/src/main/resources/static/src/topic.js
@@ -141,7 +141,7 @@ module.controller('topicController', ['$scope', 'ngDialog',
'$http', 'Notificati
return true
}
}
- if (localStorage.getItem('isV5') && $scope.filterUnspecified) {
+ if ($scope.isRmqVersionV5() && $scope.filterUnspecified) {
if (type.includes("UNSPECIFIED")) {
return true
}
@@ -150,21 +150,21 @@ module.controller('topicController', ['$scope',
'ngDialog', '$http', 'Notificati
if (type.includes("NORMAL")) {
return true
}
- if (!localStorage.getItem('isV5') && type.includes("UNSPECIFIED"))
{
+ if (!$scope.isRmqVersionV5() && type.includes("UNSPECIFIED")) {
return true
}
}
- if (localStorage.getItem('isV5') && $scope.filterDelay) {
+ if ($scope.isRmqVersionV5() && $scope.filterDelay) {
if (type.includes("DELAY")) {
return true
}
}
- if (localStorage.getItem('isV5') && $scope.filterFifo) {
+ if ($scope.isRmqVersionV5() && $scope.filterFifo) {
if (type.includes("FIFO")) {
return true
}
}
- if (localStorage.getItem('isV5') && $scope.filterTransaction) {
+ if ($scope.isRmqVersionV5() && $scope.filterTransaction) {
if (type.includes("TRANSACTION")) {
return true
}