This commit is contained in:
Saeed Vaziry 2024-04-14 14:53:58 +02:00
parent 8a4ef66946
commit 72b37c56fd
2 changed files with 44 additions and 45 deletions

View File

@ -1,5 +1,5 @@
<td <td
{!! $attributes->merge(["class" => "whitespace-nowrap border-t border-gray-200 px-6 py-4 text-gray-700 dark:border-gray-700 dark:text-gray-300 w-1"]) !!} {!! $attributes->merge(["class" => "whitespace-nowrap px-6 py-4 text-gray-700 dark:text-gray-300 w-1"]) !!}
> >
{{ $slot }} {{ $slot }}
</td> </td>

View File

@ -23,54 +23,53 @@
</x-card-header> </x-card-header>
<x-live id="live-server-logs"> <x-live id="live-server-logs">
<x-table> <x-table>
<x-tr> <x-thead>
<x-th>
@isset($remote)
{{ __("Path") }}
@else
{{ __("Event") }}
@endisset
</x-th>
<x-th>{{ __("Date") }}</x-th>
<x-th></x-th>
</x-tr>
@foreach ($logs as $log)
<x-tr> <x-tr>
<x-td class="flex flex-col"> <x-th>
@isset($remote) @isset($remote)
{{ $log->name }} {{ __("Path") }}
@else @else
{{ $log->type }} {{ __("Event") }}
@if ($log->is_remote) @endisset
<span class="text-sm text-gray-400"> </x-th>
{{ $log->name }} <x-th>{{ __("Date") }}</x-th>
</span> <x-th></x-th>
@endif
@endif
</x-td>
<x-td>
<x-datetime :value="$log->created_at" />
</x-td>
<x-td>
<x-icon-button
x-on:click="$dispatch('open-modal', 'show-log'); document.getElementById('log-content').firstChild.innerHTML = '';"
hx-get="{{ route('servers.logs.show', ['server' => $server, 'serverLog' => $log->id]) }}"
hx-target="#log-content"
hx-select="#log-content"
>
<x-heroicon name="o-eye" class="h-5 w-5" />
</x-icon-button>
@if (isset($remote) && ! isset($site))
<x-icon-button
x-on:click="deleteAction = '{{ route('servers.logs.remote.destroy', ['server' => $server, 'serverLog' => $log->id]) }}'; $dispatch('open-modal', 'delete-remote-log')"
>
<x-heroicon name="o-trash" class="h-5 w-5" />
</x-icon-button>
@endif
</x-td>
</x-tr> </x-tr>
@endforeach </x-thead>
<x-tbody>
@foreach ($logs as $log)
<x-tr>
<x-td>
@isset($remote)
{{ $log->name }}
@else
{{ $log->type }}
@endif
</x-td>
<x-td>
<x-datetime :value="$log->created_at" />
</x-td>
<x-td class="flex w-full justify-end">
<x-icon-button
x-on:click="$dispatch('open-modal', 'show-log'); document.getElementById('log-content').firstChild.innerHTML = '';"
hx-get="{{ route('servers.logs.show', ['server' => $server, 'serverLog' => $log->id]) }}"
hx-target="#log-content"
hx-select="#log-content"
>
<x-heroicon name="o-eye" class="h-5 w-5" />
</x-icon-button>
@if ($log->is_remote)
<x-icon-button
x-on:click="deleteAction = '{{ route('servers.logs.remote.destroy', ['server' => $server, 'serverLog' => $log->id]) }}'; $dispatch('open-modal', 'delete-remote-log')"
>
<x-heroicon name="o-trash" class="h-5 w-5" />
</x-icon-button>
@endif
</x-td>
</x-tr>
@endforeach
</x-tbody>
</x-table> </x-table>
@if ($logs instanceof \Illuminate\Pagination\LengthAwarePaginator) @if ($logs instanceof \Illuminate\Pagination\LengthAwarePaginator)
<div class="mt-5"> <div class="mt-5">