@@ -45,24 +45,30 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
4545 }
4646 } ;
4747 $scope . filterNormal = true
48+ $scope . filterDelay = false
49+ $scope . filterFifo = false
50+ $scope . filterTransaction = false
4851 $scope . filterRetry = false
4952 $scope . filterDLQ = false
5053 $scope . filterSystem = false
5154 $scope . allTopicList = [ ] ;
55+ $scope . allTopicNameList = [ ] ;
56+ $scope . allMessageTypeList = [ ] ;
5257 $scope . topicShowList = [ ] ;
5358 $scope . userRole = $window . sessionStorage . getItem ( "userrole" ) ;
54- $scope . writeOperationEnabled = $scope . userRole == null ? true : ( $scope . userRole == 1 ? true : false ) ;
59+ $scope . writeOperationEnabled = $scope . userRole == null ? true : ( $scope . userRole == 1 ? true : false ) ;
5560
5661 $scope . refreshTopicList = function ( ) {
5762 $http ( {
5863 method : "GET" ,
59- url : "topic/list.query "
64+ url : "topic/list.queryTopicType "
6065 } ) . success ( function ( resp ) {
6166 if ( resp . status == 0 ) {
62- $scope . allTopicList = resp . data . topicList . sort ( ) ;
63- console . log ( $scope . allTopicList ) ;
67+ $scope . allTopicNameList = resp . data . topicNameList ;
68+ $scope . allMessageTypeList = resp . data . messageTypeList ;
69+ console . log ( $scope . allTopicNameList ) ;
6470 console . log ( JSON . stringify ( resp ) ) ;
65- $scope . showTopicList ( 1 , $scope . allTopicList . length ) ;
71+ $scope . showTopicList ( 1 , $scope . allTopicNameList . length ) ;
6672
6773 } else {
6874 Notification . error ( { message : resp . errMsg , delay : 5000 } ) ;
@@ -79,6 +85,15 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
7985 $scope . $watch ( 'filterNormal' , function ( ) {
8086 $scope . filterList ( 1 ) ;
8187 } ) ;
88+ $scope . $watch ( 'filterFifo' , function ( ) {
89+ $scope . filterList ( 1 ) ;
90+ } ) ;
91+ $scope . $watch ( 'filterTransaction' , function ( ) {
92+ $scope . filterList ( 1 ) ;
93+ } ) ;
94+ $scope . $watch ( 'filterDelay' , function ( ) {
95+ $scope . filterList ( 1 ) ;
96+ } ) ;
8297 $scope . $watch ( 'filterRetry' , function ( ) {
8398 $scope . filterList ( 1 ) ;
8499 } ) ;
@@ -92,21 +107,21 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
92107 var lowExceptStr = $scope . filterStr . toLowerCase ( ) ;
93108 var canShowList = [ ] ;
94109
95- $scope . allTopicList . forEach ( function ( element ) {
96- if ( $scope . filterByType ( element ) ) {
97- if ( element . toLowerCase ( ) . indexOf ( lowExceptStr ) != - 1 ) {
98- canShowList . push ( element ) ;
110+ for ( let i = 0 ; i < $scope . allTopicNameList . length ; ++ i ) {
111+ if ( $scope . filterByType ( $scope . allTopicNameList [ i ] , $scope . allMessageTypeList [ i ] ) ) {
112+ if ( $scope . allTopicNameList [ i ] . toLowerCase ( ) . indexOf ( lowExceptStr ) != - 1 ) {
113+ canShowList . push ( $scope . allTopicNameList [ i ] ) ;
99114 }
100115 }
101- } ) ;
116+ }
102117 $scope . paginationConf . totalItems = canShowList . length ;
103118 var perPage = $scope . paginationConf . itemsPerPage ;
104119 var from = ( currentPage - 1 ) * perPage ;
105120 var to = ( from + perPage ) > canShowList . length ? canShowList . length : from + perPage ;
106121 $scope . topicShowList = canShowList . slice ( from , to ) ;
107122 } ;
108123
109- $scope . filterByType = function ( str ) {
124+ $scope . filterByType = function ( str , type ) {
110125 if ( $scope . filterRetry ) {
111126 if ( str . startsWith ( "%R" ) ) {
112127 return true
@@ -123,7 +138,22 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
123138 }
124139 }
125140 if ( $scope . filterNormal ) {
126- if ( str . startsWith ( "%" ) == false ) {
141+ if ( type . includes ( "NORMAL" ) ) {
142+ return true
143+ }
144+ }
145+ if ( $scope . filterDelay ) {
146+ if ( type . includes ( "DELAY" ) ) {
147+ return true
148+ }
149+ }
150+ if ( $scope . filterFifo ) {
151+ if ( type . includes ( "FIFO" ) ) {
152+ return true
153+ }
154+ }
155+ if ( $scope . filterTransaction ) {
156+ if ( type . includes ( "TRANSACTION" ) ) {
127157 return true
128158 }
129159 }
@@ -138,10 +168,10 @@ module.controller('topicController', ['$scope', 'ngDialog', '$http', 'Notificati
138168 var perPage = $scope . paginationConf . itemsPerPage ;
139169 var from = ( currentPage - 1 ) * perPage ;
140170 var to = ( from + perPage ) > totalItem ? totalItem : from + perPage ;
141- console . log ( $scope . allTopicList ) ;
171+ console . log ( $scope . allTopicNameList ) ;
142172 console . log ( from )
143173 console . log ( to )
144- $scope . topicShowList = $scope . allTopicList . slice ( from , to ) ;
174+ $scope . topicShowList = $scope . allTopicNameList . slice ( from , to ) ;
145175 $scope . paginationConf . totalItems = totalItem ;
146176 console . log ( $scope . topicShowList )
147177 console . log ( $scope . paginationConf . totalItems )
0 commit comments