Skip to content

Commit 1aad0cd

Browse files
authored
front js check is v5 'false' will be true fix (#269)
1 parent e57d423 commit 1aad0cd

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/main/resources/static/src/consumer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.controller('consumerController', ['$scope', 'ngDialog', '$http', 'Notific
7979
url: "consumer/groupList.query",
8080
params: {
8181
skipSysGroup: false,
82-
address: localStorage.getItem('isV5') ? localStorage.getItem('proxyAddr') : null
82+
address: $scope.isRmqVersionV5() ? localStorage.getItem('proxyAddr') : null
8383
}
8484
}).success(function (resp) {
8585
if (resp.status == 0) {

src/main/resources/static/src/controller.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ app.controller('AppCtrl', ['$scope','$window','$translate','$http','Notification
2727
localStorage.setItem("isV5", v);
2828
}
2929

30+
$scope.isRmqVersionV5 = function(){
31+
var v=localStorage.getItem('isV5');
32+
//for js !! 'false' is true!
33+
if( /false/i.test(v) ){
34+
return false;
35+
}
36+
return !! v;
37+
}
38+
3039
$scope.logout = function(){
3140
$http({
3241
method: "POST",

src/main/resources/static/src/topic.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
141141
return true
142142
}
143143
}
144-
if (localStorage.getItem('isV5') && $scope.filterUnspecified) {
144+
if ($scope.isRmqVersionV5() && $scope.filterUnspecified) {
145145
if (type.includes("UNSPECIFIED")) {
146146
return true
147147
}
@@ -150,21 +150,21 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
150150
if (type.includes("NORMAL")) {
151151
return true
152152
}
153-
if (!localStorage.getItem('isV5') && type.includes("UNSPECIFIED")) {
153+
if (!$scope.isRmqVersionV5() && type.includes("UNSPECIFIED")) {
154154
return true
155155
}
156156
}
157-
if (localStorage.getItem('isV5') && $scope.filterDelay) {
157+
if ($scope.isRmqVersionV5() && $scope.filterDelay) {
158158
if (type.includes("DELAY")) {
159159
return true
160160
}
161161
}
162-
if (localStorage.getItem('isV5') && $scope.filterFifo) {
162+
if ($scope.isRmqVersionV5() && $scope.filterFifo) {
163163
if (type.includes("FIFO")) {
164164
return true
165165
}
166166
}
167-
if (localStorage.getItem('isV5') && $scope.filterTransaction) {
167+
if ($scope.isRmqVersionV5() && $scope.filterTransaction) {
168168
if (type.includes("TRANSACTION")) {
169169
return true
170170
}

0 commit comments

Comments
 (0)