diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index 54281387b..5e4102cc0 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -380,9 +380,11 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', }).error(defaultErrorHandler(callback)); }; - Client.prototype.getEventLogs = function (page, perPage, callback) { + Client.prototype.getEventLogs = function (action, search, page, perPage, callback) { var config = { params: { + action: action, + search: search, page: page, per_page: perPage } diff --git a/webadmin/src/theme.scss b/webadmin/src/theme.scss index cac7c65a2..c9e7bf2bb 100644 --- a/webadmin/src/theme.scss +++ b/webadmin/src/theme.scss @@ -1029,3 +1029,15 @@ $graphs-success-alt: lighten(#27CE65, 20%); } } } + +.filter { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 2px; + + .form-control { + display: inline-block; + width: 200px; + } +} diff --git a/webadmin/src/views/activity.html b/webadmin/src/views/activity.html index d0acb6b91..d0efd32ba 100644 --- a/webadmin/src/views/activity.html +++ b/webadmin/src/views/activity.html @@ -2,17 +2,25 @@
-
-

Activity Log

-
- - -
+
+
+
+ + +
+ +
+
diff --git a/webadmin/src/views/activity.js b/webadmin/src/views/activity.js index 9cd99fcfe..77b5a51d8 100644 --- a/webadmin/src/views/activity.js +++ b/webadmin/src/views/activity.js @@ -5,14 +5,34 @@ angular.module('Application').controller('ActivityController', ['$scope', '$loca $scope.eventLogs = [ ]; + $scope.actions = [ + { name: 'cloudron.activate', value: 'cloudron.activate' }, + { name: 'app.configure', value: 'app.configure' }, + { name: 'app.install', value: 'app.install' }, + { name: 'app.restore', value: 'app.restore' }, + { name: 'app.uninstall', value: 'app.uninstall' }, + { name: 'app.update', value: 'app.update' }, + { name: 'backup.finish', value: 'backup.finish' }, + { name: 'backup.start', value: 'backup.start' }, + { name: 'certificate.renew', value: 'certificate.renew' }, + { name: 'settings.climode', value: 'settings.climode' }, + { name: 'cloudron.start', value: 'cloudron.start' }, + { name: 'cloudron.update', value: 'cloudron.update' }, + { name: 'user.add', value: 'user.add' }, + { name: 'user.login', value: 'user.login' }, + { name: 'user.remove', value: 'user.remove' }, + { name: 'user.update', value: 'user.update' } + ]; + $scope.currentPage = 1; $scope.pageItems = 20; - + $scope.action = ''; + $scope.search = ''; function fetchEventLogs() { $scope.busy = true; - Client.getEventLogs($scope.currentPage, $scope.pageItems, function (error, eventLogs) { + Client.getEventLogs($scope.action ? $scope.action.value : null, $scope.search || null, $scope.currentPage, $scope.pageItems, function (error, eventLogs) { $scope.busy = false; if (error) return console.error(error); @@ -36,4 +56,8 @@ angular.module('Application').controller('ActivityController', ['$scope', '$loca fetchEventLogs(); }; + + $scope.updateFilter = function () { + fetchEventLogs(); + }; }]);