front js check is v5 'false' will be true fix (#269)

This commit is contained in:
iamgd67
2025-03-14 10:50:31 +08:00
committed by GitHub
parent e57d423268
commit 1aad0cda25
3 changed files with 15 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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",

View File

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