lolispace-applications/resources/views/livewire/registration-token.blade.php

67 lines
3.2 KiB
PHP

<div class="flex items-start max-md:flex-col">
<div class="flex-1 self-stretch max-md:pt-6">
<div class="relative mb-6 w-full">
<flux:heading size="xl" level="1">{{ __('Registration Tokens') }}</flux:heading>
<flux:subheading size="lg" class="mb-6">{{ __('Manage matrix registration tokens') }}
</flux:subheading>
<flux:separator variant="subtle" />
</div>
<div class="flex justify-end pb-5">
<flux:button wire:click="createToken">Create token</flux:button>
</div>
<flux:modal name="registration-token" wire:close="resetToken" class="md:w-96">
<div class="space-y-6">
<div>
<flux:heading size="lg">Registration token</flux:heading>
</div>
<flux:input class="mb-2" icon="key" value="{{ $registrationToken }}" readonly copyable />
</div>
</flux:modal>
<div class="bg-white dark:bg-zinc-900 shadow-md rounded-lg overflow-hidden">
<table class="min-w-full text-sm text-left text-zinc-700 dark:text-zinc-300">
<thead class="bg-zinc-100 dark:bg-zinc-950 text-xs uppercase text-zinc-500 dark:text-zinc-400">
<tr>
<th class="px-4 py-2 text-left hidden md:block">Token</th>
<th class="px-4 py-2">Uses allowed</th>
<th class="px-4 py-2">Pending</th>
<th class="px-4 py-2">Completed</th>
<th class="px-4 py-2">Expiry time</th>
<th class="px-4 py-2">Actions</th>
</tr>
</thead>
<tbody>
@forelse ($tokens as $token)
<tr class="border-b dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-950">
<td class="px-4 py-4 font-mono text-sm hidden md:block align-middle">{{ $token['token'] }}
</td>
<td class="px-4 py-2">
{{ $token['uses_allowed'] }}
</td>
<td class="px-4 py-2">{{ $token['pending'] }}</td>
<td class="px-4 py-2 text-sm">{{ $token['completed'] }}</td>
<td class="px-4 py-2">
{{ $token['expiry_time'] ? Carbon\Carbon::createFromTimestampMs($token['expiry_time'])->toDateTimeString() : 'Never' }}
</td>
<td>
<flux:button class="cursor-pointer" size="sm"
wire:click="revokeToken('{{ (string) $token['token'] }}')">
Revoke
</flux:button>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="text-center py-4 text-gray-500">No tokens found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>