with pagination
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
/>
|
||||
|
||||
@php
|
||||
$enabledCount = $modules->where('enabled', true)->count();
|
||||
$disabledCount = $modules->count() - $enabledCount;
|
||||
$enabledCount = $allModules->where('enabled', true)->count();
|
||||
$disabledCount = $allModules->count() - $enabledCount;
|
||||
@endphp
|
||||
|
||||
<div class="space-y-6">
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="grid gap-4 md:grid-cols-3">
|
||||
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
||||
<div class="text-xs font-semibold uppercase tracking-wide text-zinc-500">Installed</div>
|
||||
<div class="mt-2 text-3xl font-bold text-zinc-900 dark:text-zinc-100">{{ $modules->count() }}</div>
|
||||
<div class="mt-2 text-3xl font-bold text-zinc-900 dark:text-zinc-100">{{ $allModules->count() }}</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
||||
@@ -34,20 +34,52 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-4 rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-800 dark:bg-zinc-900 md:flex-row md:items-center md:justify-between">
|
||||
<div class="flex flex-col gap-4 rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-800 dark:bg-zinc-900 xl:flex-row xl:items-end xl:justify-between">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold text-zinc-900 dark:text-zinc-100">Installed modules</h2>
|
||||
<p class="text-sm text-zinc-500 dark:text-zinc-400">
|
||||
Enabled state, sort order, and custom descriptions are stored only in the database.
|
||||
Enabled state, sort order, custom descriptions, and version numbers are stored only in the database.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ route('modules.control.sync') }}">
|
||||
@csrf
|
||||
<button type="submit" class="rounded-xl border border-zinc-300 px-4 py-2 text-sm font-semibold text-zinc-800 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-100 dark:hover:bg-zinc-800">
|
||||
Sync Database
|
||||
</button>
|
||||
</form>
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
|
||||
<form method="GET" action="{{ route('modules.control.index') }}" class="flex flex-col gap-2 sm:flex-row sm:items-center">
|
||||
<label for="module-search" class="sr-only">Search modules</label>
|
||||
<input
|
||||
id="module-search"
|
||||
type="search"
|
||||
name="search"
|
||||
value="{{ $search }}"
|
||||
placeholder="Search modules..."
|
||||
class="w-full rounded-xl border border-zinc-300 bg-white px-4 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100 dark:placeholder:text-zinc-500 sm:w-72"
|
||||
/>
|
||||
<button type="submit" class="rounded-xl border border-blue-500/40 bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/30">
|
||||
Search
|
||||
</button>
|
||||
@if ($search !== '')
|
||||
<a href="{{ route('modules.control.index') }}" class="rounded-xl border border-zinc-300 px-4 py-2 text-sm font-semibold text-zinc-800 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-100 dark:hover:bg-zinc-800">
|
||||
Clear
|
||||
</a>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
<form method="POST" action="{{ route('modules.control.sync') }}">
|
||||
@csrf
|
||||
<button type="submit" class="rounded-xl border border-zinc-300 px-4 py-2 text-sm font-semibold text-zinc-800 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-100 dark:hover:bg-zinc-800">
|
||||
Sync Database
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1 text-sm text-zinc-500 dark:text-zinc-400 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
Showing {{ $modules->firstItem() ?? 0 }}-{{ $modules->lastItem() ?? 0 }} of {{ $modules->total() }} modules.
|
||||
@if ($search !== '')
|
||||
Search: <span class="font-semibold text-zinc-800 dark:text-zinc-200">{{ $search }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div>4 modules per page</div>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-4 xl:grid-cols-2">
|
||||
@@ -148,5 +180,11 @@
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
@if ($modules->hasPages())
|
||||
<div class="rounded-2xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
||||
{{ $modules->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
|
||||
Reference in New Issue
Block a user