Files
Scheduler/resources/views/livewire/bots-list.blade.php

66 lines
2.5 KiB
PHP

<div>
<table class="table w-full">
<thead>
<tr>
<th class="border px-4 py-2">Name</th>
<th class="border px-4 py-2">Schema</th>
<th class="border px-4 py-2">Schedule</th>
<th class="border px-4 py-2">Next due</th>
<th class="border px-4 py-2">Enabled</th>
<th class="border px-4 py-2">Actions</th>
</tr>
</thead>
<tbody class="text-center">
@foreach ($bots as $bot)
<tr>
<td class="px-4 py-2">
<a
wire:navigate
href="{{ route('bots.edit', $bot) }}"
class="text-blue-500"
>
{{ $bot->name }}
</a>
</td>
<td class="px-4 py-2">{{ $bot->class_name }}</td>
<td class="px-4 py-2">
{{ $bot->schedule }}
<span class="text-gray-300">
({{ $bot->cron_to_human }})
</span>
</td>
<td class="px-4 py-2">{{ $bot->next_due }}</td>
<td class="px-4 py-2">
<input
type="checkbox"
@checked($bot->enabled)
wire:click="toggleBot({{ $bot->id }})"
/>
</td>
<td>
<button
wire:click="runBot({{ $bot->id }})"
class="ml-4 cursor-pointer"
>
<i class="fas fa-play"></i>
</button>
<button
href="{{ route('bots.edit', $bot) }}"
wire:navigate
class="ml-4 cursor-pointer"
>
<i class="fas fa-edit"></i>
</button>
<button
wire:click="deleteBot({{ $bot->id }})"
class="ml-4 cursor-pointer"
>
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>