Add first pass of the web interface: Sites index + detail, via Livewire

Home page is now a Livewire-powered, searchable/paginated Site list
(search by domain) instead of the stock Laravel welcome page. Clicking
a site goes to a plain controller-rendered detail page listing its
pages. Shared layout at resources/views/components/layouts/app.blade.php.
This commit is contained in:
m105
2026-07-22 21:16:17 +03:00
parent 4dd5a3c17d
commit f15eb5aec1
10 changed files with 1876 additions and 228 deletions
+54
View File
@@ -0,0 +1,54 @@
<x-layouts.app :title="$site->domain">
<div class="mx-auto max-w-5xl px-4 py-8">
<a href="{{ route('sites.index') }}" class="text-sm text-blue-600 hover:underline dark:text-blue-400">&larr; Back to sites</a>
<h1 class="mt-2 text-2xl font-semibold">{{ $site->domain }}</h1>
@if ($site->title)
<p class="mt-1 text-neutral-700 dark:text-neutral-300">{{ $site->title }}</p>
@endif
@if ($site->description)
<p class="mt-1 text-sm text-neutral-500">{{ $site->description }}</p>
@endif
@if ($site->url)
<p class="mt-1 text-sm">
<a href="{{ $site->url }}" target="_blank" rel="noopener" class="text-blue-600 hover:underline dark:text-blue-400">{{ $site->url }}</a>
</p>
@endif
<h2 class="mt-8 text-lg font-medium">Pages ({{ $pages->total() }})</h2>
<div class="mt-4 overflow-hidden rounded-lg border border-neutral-200 dark:border-neutral-800">
<table class="min-w-full divide-y divide-neutral-200 dark:divide-neutral-800">
<thead class="bg-neutral-50 dark:bg-neutral-900">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium uppercase tracking-wide text-neutral-500">URL</th>
<th class="px-4 py-2 text-left text-xs font-medium uppercase tracking-wide text-neutral-500">Title</th>
<th class="px-4 py-2 text-right text-xs font-medium uppercase tracking-wide text-neutral-500">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-neutral-200 dark:divide-neutral-800">
@forelse ($pages as $page)
<tr>
<td class="max-w-md truncate px-4 py-2 text-sm">
<a href="{{ $page->url }}" target="_blank" rel="noopener" class="text-blue-600 hover:underline dark:text-blue-400">{{ $page->url }}</a>
</td>
<td class="px-4 py-2 text-sm text-neutral-600 dark:text-neutral-400">{{ $page->title ?? '—' }}</td>
<td class="px-4 py-2 text-right text-sm text-neutral-600 dark:text-neutral-400">{{ $page->status ?? '—' }}</td>
</tr>
@empty
<tr>
<td colspan="3" class="px-4 py-6 text-center text-sm text-neutral-500">No pages found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">
{{ $pages->links() }}
</div>
</div>
</x-layouts.app>