[ISSUE #54]Add filtering function when querying message consumption. (#56)

This commit is contained in:
zhangjidi2016
2022-01-05 09:19:33 +08:00
committed by GitHub
parent 8acd94c89a
commit 560b56e9dc
2 changed files with 23 additions and 3 deletions

View File

@@ -210,7 +210,8 @@ module.controller('messageController', ['$scope', 'ngDialog', '$http', 'Notifica
}]); }]);
module.controller('messageDetailViewDialogController', ['$scope', 'ngDialog', '$http', 'Notification', function ($scope, ngDialog, $http, Notification) { 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) { $scope.resendMessage = function (messageView, consumerGroup) {
var topic = messageView.topic; var topic = messageView.topic;
var msgId = messageView.msgId; 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;
});
}] }]
); );

View File

@@ -230,7 +230,13 @@
</div> </div>
</form> </form>
</div> </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"> <table class="table-bordered table text-middle">
<tr> <tr>
<th class="text-center">consumerGroup</th> <th class="text-center">consumerGroup</th>
@@ -238,7 +244,7 @@
<!--<th class="text-center">exceptionDesc</th>--> <!--<th class="text-center">exceptionDesc</th>-->
<th class="text-center">Operation</th> <th class="text-center">Operation</th>
</tr> </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.consumerGroup}}</td>
<td class="text-center">{{item.trackType}}</td> <td class="text-center">{{item.trackType}}</td>
<td class="text-center"> <td class="text-center">