Initial work

This commit is contained in:
2025-08-30 16:11:06 +02:00
parent 4e5f154492
commit 774d1cf45f
41 changed files with 1217 additions and 281 deletions

View File

@@ -1,5 +1,4 @@
<div class="flex flex-col gap-6">
<x-auth-header :title="__('Log in to your account')" :description="__('Enter your email and password below to log in')" />
<!-- Session Status -->
<x-auth-session-status class="text-center" :status="session('status')" />
@@ -42,11 +41,4 @@
<flux:button variant="primary" type="submit" class="w-full">{{ __('Log in') }}</flux:button>
</div>
</form>
@if (Route::has('register'))
<div class="space-x-1 rtl:space-x-reverse text-center text-sm text-zinc-600 dark:text-zinc-400">
<span>{{ __('Don\'t have an account?') }}</span>
<flux:link :href="route('register')" wire:navigate>{{ __('Sign up') }}</flux:link>
</div>
@endif
</div>

View File

@@ -0,0 +1,39 @@
<div>
<table class="table w-full">
<thead>
<tr>
<th class="border px-4 py-2">Name</th>
<th class="border px-4 py-2">Class</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>
</tr>
</thead>
<tbody class="text-center">
@foreach ($bots as $bot)
<tr>
<td class="border px-4 py-2">
<a href="{{ route('bots.edit', $bot) }}" class="text-blue-500">
{{ $bot->name }}
</a>
</td>
<td class="border px-4 py-2">{{ $bot->class }}</td>
<td class="border px-4 py-2">
{{ $bot->schedule }}
<span class="text-gray-300">
({{ $bot->cron_to_human }})
</span>
</td>
<td class="border px-4 py-2">{{ $bot->next_due }}</td>
<td class="border px-4 py-2">
<input
type="checkbox"
@checked($bot->enabled)
wire:click="toggleBot({{ $bot->id }})"
/>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>

View File

@@ -0,0 +1,76 @@
<div>
<div class="mb-4">
<input
wire:model.live="name"
type="text"
placeholder="Bot Name"
class="border p-2 rounded mb-2 w-full"
/>
@error('name')
<span class="text-red-500">{{ $message }}</span>
@enderror
</div>
<div>
<select wire:model.live="class" class="border p-2 rounded mb-2 w-full">
<option hidden selected>Select Bot Schema</option>
@foreach ($classList as $label => $class)
<option class="text-black" value="{{ $label }}">
{{ $label }}
</option>
@endforeach
</select>
@error('bot')
<span class="text-red-500">{{ $message }}</span>
@enderror
</div>
<div class="mt-6">
<input
wire:model.live="schedule"
type="text"
placeholder="Schedule (CRON)"
class="border p-2 rounded mb-2 w-full"
/>
<span>
{{ $cron_text }}
</span>
@error('schedule')
<span class="text-red-500">{{ $message }}</span>
@enderror
</div>
<div class="mt-4">
<h2>Config</h2>
@forelse ($configSchema as $field => $meta)
<label>{{ $meta['label'] }}</label>
<input
class="border p-2 rounded mb-2 w-full"
type="text"
name="config[{{ $field }}]"
value="{{ old("config.$field", $bot->config[$field] ?? '') }}"
/>
@error('config.' . $field)
<span class="text-red-500">{{ $message }}</span>
@enderror
@empty
Select a bot first
@endforelse
</div>
<div class="mt-6">
<label class="inline-flex items-center">
<input type="checkbox" wire:model="enabled" class="form-checkbox" />
<span class="ml-2">Enabled</span>
</label>
</div>
<div>
<button
wire:click="save"
class="mt-6 bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
>
{{ $routeName }}
</button>
</div>
</div>