Skip to content

Commit

Permalink
[ISSUE #54]Add filtering function when querying message consumption. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjidi2016 authored Jan 5, 2022
1 parent 8acd94c commit 560b56e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/main/resources/static/src/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
});
}]
);
10 changes: 8 additions & 2 deletions src/main/resources/static/view/pages/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,21 @@ <h5 class="md-display-5">topic can't be empty if you producer client version>=v3
</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>
<th class="text-center">trackType</th>
<!--<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">
Expand Down

0 comments on commit 560b56e

Please sign in to comment.