2021-08-22 14:15:58 +02:00
|
|
|
@extends('layouts.simple')
|
2020-09-19 13:06:45 +02:00
|
|
|
|
|
|
|
@section('body')
|
|
|
|
<div class="container">
|
|
|
|
|
2022-03-26 22:36:05 +01:00
|
|
|
@include('settings.parts.navbar', ['selected' => 'audit'])
|
2020-09-19 13:06:45 +02:00
|
|
|
|
|
|
|
<div class="card content-wrap auto-height">
|
2021-12-07 15:55:11 +01:00
|
|
|
<h1 class="list-heading">{{ trans('settings.audit') }}</h1>
|
2020-09-19 13:06:45 +02:00
|
|
|
<p class="text-muted">{{ trans('settings.audit_desc') }}</p>
|
|
|
|
|
2022-05-14 17:05:29 +02:00
|
|
|
<form action="{{ url('/settings/audit') }}" method="get" class="flex-container-row wrap justify-flex-start gap-m">
|
|
|
|
|
|
|
|
<div component="dropdown" class="list-sort-type dropdown-container">
|
2020-09-19 13:06:45 +02:00
|
|
|
<label for="">{{ trans('settings.audit_event_filter') }}</label>
|
|
|
|
<button refs="dropdown@toggle" aria-haspopup="true" aria-expanded="false" aria-label="{{ trans('common.sort_options') }}" class="input-base text-left">{{ $listDetails['event'] ?: trans('settings.audit_event_filter_no_filter') }}</button>
|
|
|
|
<ul refs="dropdown@menu" class="dropdown-menu">
|
2022-04-20 15:03:47 +02:00
|
|
|
<li @if($listDetails['event'] === '') class="active" @endif><a href="{{ sortUrl('/settings/audit', $listDetails, ['event' => '']) }}" class="text-item">{{ trans('settings.audit_event_filter_no_filter') }}</a></li>
|
2020-11-08 01:03:19 +01:00
|
|
|
@foreach($activityTypes as $type)
|
2022-04-20 15:03:47 +02:00
|
|
|
<li @if($type === $listDetails['event']) class="active" @endif><a href="{{ sortUrl('/settings/audit', $listDetails, ['event' => $type]) }}" class="text-item">{{ $type }}</a></li>
|
2020-09-19 13:06:45 +02:00
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2022-05-14 17:05:29 +02:00
|
|
|
@if(!empty($listDetails['event']))
|
|
|
|
<input type="hidden" name="event" value="{{ $listDetails['event'] }}">
|
|
|
|
@endif
|
2021-03-21 16:04:32 +01:00
|
|
|
|
2022-05-14 17:05:29 +02:00
|
|
|
@foreach(['date_from', 'date_to'] as $filterKey)
|
|
|
|
<div class=>
|
|
|
|
<label for="audit_filter_{{ $filterKey }}">{{ trans('settings.audit_' . $filterKey) }}</label>
|
|
|
|
<input id="audit_filter_{{ $filterKey }}"
|
|
|
|
component="submit-on-change"
|
|
|
|
type="date"
|
|
|
|
name="{{ $filterKey }}"
|
|
|
|
value="{{ $listDetails[$filterKey] ?? '' }}">
|
2021-03-21 16:04:32 +01:00
|
|
|
</div>
|
2022-05-14 17:05:29 +02:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
<div class="form-group"
|
|
|
|
component="submit-on-change"
|
|
|
|
option:submit-on-change:filter='[name="user"]'>
|
|
|
|
<label for="owner">{{ trans('settings.audit_table_user') }}</label>
|
|
|
|
@include('form.user-select', ['user' => $listDetails['user'] ? \BookStack\Auth\User::query()->find($listDetails['user']) : null, 'name' => 'user'])
|
|
|
|
</div>
|
2021-11-09 05:05:02 +01:00
|
|
|
|
|
|
|
|
2022-05-14 17:05:29 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="ip">{{ trans('settings.audit_table_ip') }}</label>
|
|
|
|
@include('form.text', ['name' => 'ip', 'model' => (object) $listDetails])
|
|
|
|
<input type="submit" style="display: none">
|
|
|
|
</div>
|
|
|
|
</form>
|
2020-09-19 13:06:45 +02:00
|
|
|
|
|
|
|
<hr class="mt-l mb-s">
|
|
|
|
|
|
|
|
{{ $activities->links() }}
|
|
|
|
|
|
|
|
<table class="table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('settings.audit_table_user') }}</th>
|
|
|
|
<th>
|
|
|
|
<a href="{{ sortUrl('/settings/audit', $listDetails, ['sort' => 'key']) }}">{{ trans('settings.audit_table_event') }}</a>
|
|
|
|
</th>
|
2020-11-20 20:33:11 +01:00
|
|
|
<th>{{ trans('settings.audit_table_related') }}</th>
|
2021-09-26 18:18:12 +02:00
|
|
|
<th>{{ trans('settings.audit_table_ip') }}</th>
|
2020-09-19 13:06:45 +02:00
|
|
|
<th>
|
|
|
|
<a href="{{ sortUrl('/settings/audit', $listDetails, ['sort' => 'created_at']) }}">{{ trans('settings.audit_table_date') }}</a></th>
|
|
|
|
</tr>
|
|
|
|
@foreach($activities as $activity)
|
|
|
|
<tr>
|
|
|
|
<td>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('settings.parts.table-user', ['user' => $activity->user, 'user_id' => $activity->user_id])
|
2020-09-19 13:06:45 +02:00
|
|
|
</td>
|
2020-11-08 01:03:19 +01:00
|
|
|
<td>{{ $activity->type }}</td>
|
2021-01-03 20:02:50 +01:00
|
|
|
<td width="40%">
|
2020-09-19 13:06:45 +02:00
|
|
|
@if($activity->entity)
|
2020-10-03 19:44:12 +02:00
|
|
|
<a href="{{ $activity->entity->getUrl() }}" class="table-entity-item">
|
2020-09-19 13:06:45 +02:00
|
|
|
<span role="presentation" class="icon text-{{$activity->entity->getType()}}">@icon($activity->entity->getType())</span>
|
|
|
|
<div class="text-{{ $activity->entity->getType() }}">
|
|
|
|
{{ $activity->entity->name }}
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-11-20 20:33:11 +01:00
|
|
|
@elseif($activity->detail && $activity->isForEntity())
|
2020-09-19 13:06:45 +02:00
|
|
|
<div class="px-m">
|
|
|
|
{{ trans('settings.audit_deleted_item') }} <br>
|
2020-11-08 01:03:19 +01:00
|
|
|
{{ trans('settings.audit_deleted_item_name', ['name' => $activity->detail]) }}
|
2020-09-19 13:06:45 +02:00
|
|
|
</div>
|
2020-11-20 20:33:11 +01:00
|
|
|
@elseif($activity->detail)
|
|
|
|
<div class="px-m">{{ $activity->detail }}</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
@endif
|
|
|
|
</td>
|
2021-08-27 06:53:47 +02:00
|
|
|
<td>{{ $activity->ip }}</td>
|
2020-09-19 13:06:45 +02:00
|
|
|
<td>{{ $activity->created_at }}</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
{{ $activities->links() }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@stop
|