Allow to select multiple actions in the eventlog filter

This commit is contained in:
Johannes Zellner
2018-03-05 11:15:25 +01:00
parent 91265613a9
commit d2d8eb9485
3 changed files with 10 additions and 8 deletions

View File

@@ -559,10 +559,10 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.getEventLogs = function (action, search, page, perPage, callback) {
Client.prototype.getEventLogs = function (actions, search, page, perPage, callback) {
var config = {
params: {
action: action,
actions: actions,
search: search,
page: page,
per_page: perPage

View File

@@ -8,12 +8,12 @@
<div>
<div class="col-md-10 col-md-offset-1">
<div class="filter">
<input type="text" class="form-control" ng-model="search" ng-model-options="{ debounce: 1000 }" ng-change="updateFilter()" placeholder="Search"/>
<select class="form-control" ng-model="action" ng-options="a.name for a in actions" ng-change="updateFilter()">
<input type="text" class="form-control" style="min-width: 350px;" ng-model="search" ng-model-options="{ debounce: 1000 }" ng-change="updateFilter()" placeholder="Search"/>
<multiselect ng-model="selectedActions" ms-header="All Actions" options="a.name for a in actions" data-multiple="true" ng-change="updateFilter(true)"></multiselect>
<select class="form-control" ng-model="pageItems" ng-options="a.name for a in pageItemCount" ng-change="updateFilter(true)"></select>
<!-- <select class="form-control" ng-model="action" ng-options="a.name for a in actions" ng-change="updateFilter()">
<option value="">-- All actions --</option>
</select>
<select class="form-control" ng-model="pageItems" ng-options="a.name for a in pageItemCount" ng-change="updateFilter(true)">
</select>
</select> -->
</div>
<div class="pagination pull-right">
<button class="btn btn-default btn-outline" ng-click="showPrevPage()" ng-disabled="busy || currentPage <= 1"><i class="fa fa-angle-double-left"></i> prev</button>

View File

@@ -40,12 +40,14 @@ angular.module('Application').controller('ActivityController', ['$scope', '$loca
$scope.currentPage = 1;
$scope.pageItems = $scope.pageItemCount[0];
$scope.action = '';
$scope.selectedActions = [];
$scope.search = '';
function fetchEventLogs() {
$scope.busy = true;
var actions = $scope.selectedActions.map(function (a) { return a.value; }).join(', ');
Client.getEventLogs($scope.action ? $scope.action.value : null, $scope.search || null, $scope.currentPage, $scope.pageItems.value, function (error, eventLogs) {
Client.getEventLogs(actions, $scope.search || null, $scope.currentPage, $scope.pageItems.value, function (error, eventLogs) {
$scope.busy = false;
if (error) return console.error(error);