You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by vo...@apache.org on 2022/01/05 01:19:37 UTC

[rocketmq-dashboard] branch master updated: [ISSUE #54]Add filtering function when querying message consumption. (#56)

This is an automated email from the ASF dual-hosted git repository.

vongosling 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 560b56e  [ISSUE #54]Add filtering function when querying message consumption. (#56)
560b56e is described below

commit 560b56e9dc088aa09c6d4ac9720a2405f93fd252
Author: zhangjidi2016 <10...@qq.com>
AuthorDate: Wed Jan 5 09:19:33 2022 +0800

    [ISSUE #54]Add filtering function when querying message consumption. (#56)
---
 src/main/resources/static/src/message.js          | 16 +++++++++++++++-
 src/main/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 @@
                 </div>
             </form>
         </div>
-        <p>messageTrackList:</p>
+        <div style="font-weight:700; color:#000">messageTrackList:</div>
+        <form class="form-inline">
+            <div class="form-group">
+                <label>consumerGroup:</label>
+                <input type="text" class="form-control" ng-model="filterConsumerGroup">
+            </div>
+        </form>
         <table class="table-bordered table text-middle">
             <tr>
                 <th class="text-center">consumerGroup</th>
@@ -238,7 +244,7 @@
                 <!--<th class="text-center">exceptionDesc</th>-->
                 <th class="text-center">Operation</th>
             </tr>
-            <tr ng-repeat="item in ngDialogData.messageTrackList">
+            <tr ng-repeat="item in messageTrackShowList">
                 <td class="text-center">{{item.consumerGroup}}</td>
                 <td class="text-center">{{item.trackType}}</td>
                 <td class="text-center">