2021-08-22 08:15:58 -04:00
|
|
|
@extends('layouts.simple')
|
2020-09-19 07:06:45 -04:00
|
|
|
|
|
|
|
@section('body')
|
|
|
|
<div class="container">
|
|
|
|
|
2022-03-26 17:36:05 -04:00
|
|
|
@include('settings.parts.navbar', ['selected' => 'audit'])
|
2020-09-19 07:06:45 -04:00
|
|
|
|
|
|
|
<div class="card content-wrap auto-height">
|
2021-12-07 09:55:11 -05:00
|
|
|
<h1 class="list-heading">{{ trans('settings.audit') }}</h1>
|
2020-09-19 07:06:45 -04:00
|
|
|
<p class="text-muted">{{ trans('settings.audit_desc') }}</p>
|
|
|
|
|
2022-10-30 16:24:08 -04: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 11:05:29 -04:00
|
|
|
|
|
|
|
<div component="dropdown" class="list-sort-type dropdown-container">
|
2020-09-19 07:06:45 -04:00
|
|
|
<label for="">{{ trans('settings.audit_event_filter') }}</label>
|
2022-08-09 07:58:10 -04:00
|
|
|
<button refs="dropdown@toggle"
|
|
|
|
type="button"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false"
|
|
|
|
aria-label="{{ trans('common.sort_options') }}"
|
2022-10-30 16:24:08 -04:00
|
|
|
class="input-base text-left">{{ $filters['event'] ?: trans('settings.audit_event_filter_no_filter') }}</button>
|
2020-09-19 07:06:45 -04:00
|
|
|
<ul refs="dropdown@menu" class="dropdown-menu">
|
2022-10-30 16:24:08 -04: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-07 19:03:19 -05:00
|
|
|
@foreach($activityTypes as $type)
|
2022-10-30 16:24:08 -04: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 07:06:45 -04:00
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2022-10-30 16:24:08 -04:00
|
|
|
@if(!empty($filters['event']))
|
|
|
|
<input type="hidden" name="event" value="{{ $filters['event'] }}">
|
2022-05-14 11:05:29 -04:00
|
|
|
@endif
|
2021-03-21 11:04:32 -04:00
|
|
|
|
2022-05-14 11:05:29 -04: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 16:24:08 -04:00
|
|
|
value="{{ $filters[$filterKey] ?? '' }}">
|
2021-03-21 11:04:32 -04:00
|
|
|
</div>
|
2022-05-14 11:05:29 -04: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 16:24:08 -04:00
|
|
|
@include('form.user-select', ['user' => $filters['user'] ? \BookStack\Auth\User::query()->find($filters['user']) : null, 'name' => 'user'])
|
2022-05-14 11:05:29 -04:00
|
|
|
</div>
|
2021-11-08 23:05:02 -05:00
|
|
|
|
|
|
|
|
2022-05-14 11:05:29 -04:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="ip">{{ trans('settings.audit_table_ip') }}</label>
|
2022-10-30 16:24:08 -04:00
|
|
|
@include('form.text', ['name' => 'ip', 'model' => (object) $filters])
|
2022-05-14 11:05:29 -04:00
|
|
|
<input type="submit" style="display: none">
|
|
|
|
</div>
|
|
|
|
</form>
|
2020-09-19 07:06:45 -04:00
|
|
|
|
2022-10-30 16:24:08 -04: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 10:33:23 -04:00
|
|
|
@include('common.sort', array_merge($listOptions->getSortControlData(), ['useQuery' => true]))
|
2022-10-30 16:24:08 -04: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 07:06:45 -04:00
|
|
|
@foreach($activities as $activity)
|
2022-10-30 16:27:41 -04: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 08:15:58 -04:00
|
|
|
@include('settings.parts.table-user', ['user' => $activity->user, 'user_id' => $activity->user_id])
|
2022-10-30 16:24:08 -04:00
|
|
|
</div>
|
2022-10-30 16:27:41 -04: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 07:06:45 -04:00
|
|
|
@if($activity->entity)
|
2022-10-30 16:24:08 -04: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 07:06:45 -04:00
|
|
|
{{ $activity->entity->name }}
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-11-20 14:33:11 -05:00
|
|
|
@elseif($activity->detail && $activity->isForEntity())
|
2022-10-30 16:29:21 -04:00
|
|
|
<div>
|
2020-09-19 07:06:45 -04:00
|
|
|
{{ trans('settings.audit_deleted_item') }} <br>
|
2020-11-07 19:03:19 -05:00
|
|
|
{{ trans('settings.audit_deleted_item_name', ['name' => $activity->detail]) }}
|
2020-09-19 07:06:45 -04:00
|
|
|
</div>
|
2020-11-20 14:33:11 -05:00
|
|
|
@elseif($activity->detail)
|
2022-10-30 16:29:21 -04:00
|
|
|
<div>{{ $activity->detail }}</div>
|
2020-09-19 07:06:45 -04:00
|
|
|
@endif
|
2022-10-30 16:24:08 -04:00
|
|
|
</div>
|
2022-10-30 16:27:41 -04: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 16:24:08 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-19 07:06:45 -04:00
|
|
|
@endforeach
|
2022-10-30 16:24:08 -04:00
|
|
|
</div>
|
2020-09-19 07:06:45 -04:00
|
|
|
|
2022-10-30 16:24:08 -04:00
|
|
|
<div class="py-m">
|
|
|
|
{{ $activities->links() }}
|
|
|
|
</div>
|
2020-09-19 07:06:45 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@stop
|