Datatables

This commit is contained in:
2023-08-01 15:44:58 -04:00
parent 5a609b14f6
commit a0a2884cb3
3 changed files with 33 additions and 4 deletions

View File

@ -2,10 +2,37 @@
@section('page_content') @section('page_content')
<div class="ui container"> <div class="ui container">
<div class="ui list"> <table class="ui table" id="logs">
@foreach ($files as $file) <thead>
<a class="item" href="{{$urls->base}}/log/{{urlencode($file->getBasename())}}">[{{(new DateTimeImmutable)->setTimestamp($file->getCTime())->format('Y-m-d H:i:s')}}] {{$file->getBasename()}}</a> <tr>
<th>Date <i class="calendar icon"></i></th>
<th>File <i class="file icon"></i></th>
</tr>
</thead>
<tbody>
@foreach($files as $file)
<tr>
<td class="collapsing">
{{(new DateTimeImmutable)->setTimestamp($file->getCTime())->format('Y-m-d H:i:s')}}
</td>
<td>
<a href="{{$urls->base}}/log/{{urlencode($file->getBasename())}}">
{{$file->getBasename()}}
</a>
</td>
</tr>
@endforeach @endforeach
</div> </tbody>
</table>
</div> </div>
@endsection @endsection
@push('page_scripts')
<script type="text/javascript">
$(document).ready(() => {
new DataTable('#logs', {
order: [[0, 'desc']]
})
})
</script>
@endpush

View File

@ -1,4 +1,5 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js" integrity="sha512-5cguXwRllb+6bcc2pogwIeQmQPXEzn2ddsqAexIBhh7FO1z5Hkek1J9mrK2+rmZCTU6b6pERxI7acnp1MpAg4Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js" integrity="sha512-5cguXwRllb+6bcc2pogwIeQmQPXEzn2ddsqAexIBhh7FO1z5Hkek1J9mrK2+rmZCTU6b6pERxI7acnp1MpAg4Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
@stack('page_scripts') @stack('page_scripts')

View File

@ -1,3 +1,4 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.css" integrity="sha512-n//BDM4vMPvyca4bJjZPDh7hlqsQ7hqbP9RH18GF2hTXBY5amBwM2501M0GPiwCU/v9Tor2m13GOTFjk00tkQA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.css" integrity="sha512-n//BDM4vMPvyca4bJjZPDh7hlqsQ7hqbP9RH18GF2hTXBY5amBwM2501M0GPiwCU/v9Tor2m13GOTFjk00tkQA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="http://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
@stack('page_styles') @stack('page_styles')