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-10-30 21:24:08 +01:00
|
|
|
<form action="{{ url('/settings/audit') }}" method="get" class="flex-container-row wrap justify-flex-start gap-x-m gap-y-xs">
|
|
|
|
|
|
|
|
@foreach(request()->only(['order', 'sort']) as $key => $val)
|
|
|
|
<input type="hidden" name="{{ $key }}" value="{{ $val }}">
|
|
|
|
@endforeach
|
2022-05-14 17:05:29 +02:00
|
|
|
|
|
|
|
<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>
|
2022-08-09 13:58:10 +02:00
|
|
|
<button refs="dropdown@toggle"
|
|
|
|
type="button"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false"
|
|
|
|
aria-label="{{ trans('common.sort_options') }}"
|
2022-10-30 21:24:08 +01:00
|
|
|
class="input-base text-left">{{ $filters['event'] ?: trans('settings.audit_event_filter_no_filter') }}</button>
|
2020-09-19 13:06:45 +02:00
|
|
|
<ul refs="dropdown@menu" class="dropdown-menu">
|
2022-10-30 21:24:08 +01:00
|
|
|
<li @if($filters['event'] === '') class="active" @endif><a href="{{ sortUrl('/settings/audit', array_filter(request()->except('page')), ['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-10-30 21:24:08 +01:00
|
|
|
<li @if($type === $filters['event']) class="active" @endif><a href="{{ sortUrl('/settings/audit', array_filter(request()->except('page')), ['event' => $type]) }}" class="text-item">{{ $type }}</a></li>
|
2020-09-19 13:06:45 +02:00
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2022-10-30 21:24:08 +01:00
|
|
|
@if(!empty($filters['event']))
|
|
|
|
<input type="hidden" name="event" value="{{ $filters['event'] }}">
|
2022-05-14 17:05:29 +02:00
|
|
|
@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 }}"
|
2022-10-30 21:24:08 +01:00
|
|
|
value="{{ $filters[$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>
|
2022-10-30 21:24:08 +01:00
|
|
|
@include('form.user-select', ['user' => $filters['user'] ? \BookStack\Auth\User::query()->find($filters['user']) : null, 'name' => 'user'])
|
2022-05-14 17:05:29 +02:00
|
|
|
</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>
|
2022-10-30 21:24:08 +01:00
|
|
|
@include('form.text', ['name' => 'ip', 'model' => (object) $filters])
|
2022-05-14 17:05:29 +02:00
|
|
|
<input type="submit" style="display: none">
|
|
|
|
</div>
|
|
|
|
</form>
|
2020-09-19 13:06:45 +02:00
|
|
|
|
2022-10-30 21:24:08 +01:00
|
|
|
<hr class="mt-m mb-s">
|
|
|
|
|
|
|
|
<div class="flex-container-row justify-space-between items-center wrap">
|
|
|
|
<div class="flex-2 min-width-xl">{{ $activities->links() }}</div>
|
|
|
|
<div class="flex-none min-width-m py-m">
|
2022-11-03 15:33:23 +01:00
|
|
|
@include('common.sort', array_merge($listOptions->getSortControlData(), ['useQuery' => true]))
|
2022-10-30 21:24:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="item-list">
|
|
|
|
<div class="item-list-row flex-container-row items-center bold hide-under-m">
|
|
|
|
<div class="flex-2 px-m py-xs flex-container-row items-center">{{ trans('settings.audit_table_user') }}</div>
|
|
|
|
<div class="flex-2 px-m py-xs">{{ trans('settings.audit_table_event') }}</div>
|
|
|
|
<div class="flex-3 px-m py-xs">{{ trans('settings.audit_table_related') }}</div>
|
|
|
|
<div class="flex-container-row flex-3">
|
|
|
|
<div class="flex px-m py-xs">{{ trans('settings.audit_table_ip') }}</div>
|
|
|
|
<div class="flex-2 px-m py-xs text-right">{{ trans('settings.audit_table_date') }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
@foreach($activities as $activity)
|
2022-10-30 21:27:41 +01:00
|
|
|
<div class="item-list-row flex-container-row items-center wrap py-xxs">
|
|
|
|
<div class="flex-2 px-m py-xxs flex-container-row items-center min-width-m">
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('settings.parts.table-user', ['user' => $activity->user, 'user_id' => $activity->user_id])
|
2022-10-30 21:24:08 +01:00
|
|
|
</div>
|
2022-10-30 21:27:41 +01:00
|
|
|
<div class="flex-2 px-m py-xxs min-width-m"><strong class="mr-xs hide-over-m">{{ trans('settings.audit_table_event') }}:</strong> {{ $activity->type }}</div>
|
|
|
|
<div class="flex-3 px-m py-xxs min-width-l">
|
2020-09-19 13:06:45 +02:00
|
|
|
@if($activity->entity)
|
2022-10-30 21:24:08 +01:00
|
|
|
<a href="{{ $activity->entity->getUrl() }}" class="flex-container-row items-center">
|
|
|
|
<span role="presentation" class="icon flex-none text-{{$activity->entity->getType()}}">@icon($activity->entity->getType())</span>
|
|
|
|
<div class="flex text-{{ $activity->entity->getType() }}">
|
2020-09-19 13:06:45 +02:00
|
|
|
{{ $activity->entity->name }}
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-11-20 20:33:11 +01:00
|
|
|
@elseif($activity->detail && $activity->isForEntity())
|
2022-10-30 21:29:21 +01:00
|
|
|
<div>
|
2020-09-19 13:06:45 +02:00
|
|
|
{{ 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)
|
2022-10-30 21:29:21 +01:00
|
|
|
<div>{{ $activity->detail }}</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
@endif
|
2022-10-30 21:24:08 +01:00
|
|
|
</div>
|
2022-10-30 21:27:41 +01:00
|
|
|
<div class="flex-container-row flex-3">
|
|
|
|
<div class="flex px-m py-xxs min-width-xs"><strong class="mr-xs hide-over-m">{{ trans('settings.audit_table_ip') }}:<br></strong> {{ $activity->ip }}</div>
|
|
|
|
<div class="flex-2 px-m py-xxs text-m-right min-width-xs"><strong class="mr-xs hide-over-m">{{ trans('settings.audit_table_date') }}:<br></strong> {{ $activity->created_at }}</div>
|
2022-10-30 21:24:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
@endforeach
|
2022-10-30 21:24:08 +01:00
|
|
|
</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
|
2022-10-30 21:24:08 +01:00
|
|
|
<div class="py-m">
|
|
|
|
{{ $activities->links() }}
|
|
|
|
</div>
|
2020-09-19 13:06:45 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@stop
|