From 560b56e9dc088aa09c6d4ac9720a2405f93fd252 Mon Sep 17 00:00:00 2001 From: zhangjidi2016 <1017543663@qq.com> Date: Wed, 5 Jan 2022 09:19:33 +0800 Subject: [PATCH] [ISSUE #54]Add filtering function when querying message consumption. (#56) --- src/main/resources/static/src/message.js | 16 +++++++++++++++- .../resources/static/view/pages/message.html | 10 ++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/src/message.js b/src/main/resources/static/src/message.js index 6b54f1c..a496285 100644 --- a/src/main/resources/static/src/message.js +++ b/src/main/resources/static/src/message.js @@ -210,7 +210,8 @@ module.controller('messageController', ['$scope', 'ngDialog', '$http', 'Notifica }]); module.controller('messageDetailViewDialogController', ['$scope', 'ngDialog', '$http', 'Notification', function ($scope, ngDialog, $http, Notification) { - + $scope.messageTrackList = $scope.ngDialogData.messageTrackList; + $scope.messageTrackShowList = $scope.ngDialogData.messageTrackList; $scope.resendMessage = function (messageView, consumerGroup) { var topic = messageView.topic; var msgId = messageView.msgId; @@ -262,5 +263,18 @@ module.controller('messageDetailViewDialogController', ['$scope', 'ngDialog', '$ } }); }; + + $scope.filterConsumerGroup = ""; + $scope.$watch('filterConsumerGroup', function () { + const lowExceptStr = $scope.filterConsumerGroup.toLowerCase(); + const canShowList = []; + + $scope.messageTrackList.forEach(function (element) { + if (element.consumerGroup.toLowerCase().indexOf(lowExceptStr) != -1) { + canShowList.push(element); + } + }); + $scope.messageTrackShowList = canShowList; + }); }] ); \ No newline at end of file diff --git a/src/main/resources/static/view/pages/message.html b/src/main/resources/static/view/pages/message.html index a4bb81c..2134d82 100644 --- a/src/main/resources/static/view/pages/message.html +++ b/src/main/resources/static/view/pages/message.html @@ -230,7 +230,13 @@ -
messageTrackList:
+consumerGroup | @@ -238,7 +244,7 @@Operation | |
---|---|---|
{{item.consumerGroup}} | {{item.trackType}} |