Re-working the way audit logs work.
* Adding more checks.
This commit is contained in:
10
lemur/static/app/angular/logs/services.js
vendored
Normal file
10
lemur/static/app/angular/logs/services.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('lemur')
|
||||
.service('LogApi', function (LemurRestangular) {
|
||||
return LemurRestangular.all('domains');
|
||||
})
|
||||
.service('LogService', function () {
|
||||
var LogService = this;
|
||||
return LogService;
|
||||
});
|
31
lemur/static/app/angular/logs/view/view.js
vendored
Normal file
31
lemur/static/app/angular/logs/view/view.js
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('lemur')
|
||||
|
||||
.config(function config($stateProvider) {
|
||||
$stateProvider.state('logs', {
|
||||
url: '/logs',
|
||||
templateUrl: '/angular/logs/view/view.tpl.html',
|
||||
controller: 'DomainsViewController'
|
||||
});
|
||||
})
|
||||
|
||||
.controller('DomainsViewController', function ($scope, $uibModal, DomainApi, DomainService, ngTableParams) {
|
||||
$scope.filter = {};
|
||||
$scope.logsTable = new ngTableParams({
|
||||
page: 1, // show first page
|
||||
count: 10, // count per page
|
||||
sorting: {
|
||||
id: 'desc' // initial sorting
|
||||
},
|
||||
filter: $scope.filter
|
||||
}, {
|
||||
total: 0, // length of data
|
||||
getData: function ($defer, params) {
|
||||
DomainApi.getList(params.url()).then(function (data) {
|
||||
params.total(data.total);
|
||||
$defer.resolve(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
32
lemur/static/app/angular/logs/view/view.tpl.html
Normal file
32
lemur/static/app/angular/logs/view/view.tpl.html
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="featurette-heading">Logs
|
||||
<span class="text-muted"><small>I see what you did there</small></span></h2>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group">
|
||||
<button ng-model="showFilter" class="btn btn-default" uib-btn-checkbox
|
||||
btn-checkbox-true="1"
|
||||
btn-checkbox-false="0">Filter</button>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table ng-table="domainsTable" class="table table-striped" show-filter="showFilter" template-pagination="angular/pager.html">
|
||||
<tbody>
|
||||
<tr ng-repeat="log in $data track by $index">
|
||||
<td data-title="'Logged At'" sortable="'logged_at'" filter="{ 'logged_at': 'text' }">
|
||||
{{ log.logged_at }}
|
||||
</td>
|
||||
<td data-title="'User'" sortable="'user'" filter="{ 'user.email': 'text' }">
|
||||
{{ log.user.email }}
|
||||
</td>
|
||||
<td data-title="'Type'" sortable="'type'" filter="{ 'type': 'text' }">
|
||||
{{ log.type }}
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -55,13 +55,14 @@
|
||||
<li><a ui-sref="notifications">Notifications</a></li>
|
||||
<li></li>
|
||||
<li class="dropdown" uib-dropdown on-toggle="toggled(open)">
|
||||
<a href class="dropdown-toggle" uib-dropdown-toggle>Settings <span class="caret"></span></a>
|
||||
<a href class="dropdown-toggle" uib-dropdown-toggle>Admin <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a ui-sref="destinations">Destinations</a></li>
|
||||
<li><a ui-sref="sources">Sources</a></li>
|
||||
<li><a ui-sref="roles">Roles</a></li>
|
||||
<li><a ui-sref="users">Users</a></li>
|
||||
<li><a ui-sref="domains">Domains</a></li>
|
||||
<li><a ui-sref="log">Log</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user