- Add Superforms + Zod 4 for all admin form validation - Replace address isDefault with three separate boolean defaults (Mailing, Billing, Shipping) - Update profiles page with three-checkbox address form and toast improvements - Convert all admin page server actions to pass request directly to crud - Export superFormErrorsToFieldErrors helper for profiles server actions - Regenerate Prisma client for new schema fields
63 lines
2.0 KiB
Svelte
63 lines
2.0 KiB
Svelte
<script lang="ts">
|
|
import type { PageProps } from './$types';
|
|
|
|
let { data }: PageProps = $props();
|
|
</script>
|
|
|
|
<div class="flex h-full min-h-0 flex-col gap-6 p-6 dark:text-gray-100">
|
|
<h1 class="text-2xl font-semibold text-gray-900 dark:text-gray-100">License Keys</h1>
|
|
|
|
{#if data.licenseKeys.length > 0}
|
|
<div class="overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-700">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
<thead class="bg-gray-50 dark:bg-gray-800">
|
|
<tr>
|
|
<th
|
|
class="px-6 py-3 text-left text-xs font-medium tracking-wider text-gray-500 uppercase dark:text-gray-400"
|
|
>
|
|
Key
|
|
</th>
|
|
<th
|
|
class="px-6 py-3 text-left text-xs font-medium tracking-wider text-gray-500 uppercase dark:text-gray-400"
|
|
>
|
|
Level
|
|
</th>
|
|
<th
|
|
class="px-6 py-3 text-left text-xs font-medium tracking-wider text-gray-500 uppercase dark:text-gray-400"
|
|
>
|
|
Status
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 bg-white dark:divide-gray-700 dark:bg-gray-900">
|
|
{#each data.licenseKeys as key}
|
|
<tr>
|
|
<td
|
|
class="px-6 py-4 font-mono text-sm whitespace-nowrap text-gray-900 dark:text-gray-100"
|
|
>
|
|
{key.key}
|
|
</td>
|
|
<td class="px-6 py-4 text-sm whitespace-nowrap text-gray-700 dark:text-gray-300">
|
|
{key.level}
|
|
</td>
|
|
<td class="px-6 py-4 text-sm whitespace-nowrap">
|
|
<span
|
|
class="inline-flex rounded-full px-2 text-xs leading-5 font-semibold {key.active
|
|
? 'bg-green-100 text-green-800 dark:bg-gray-700 dark:text-gray-200'
|
|
: 'bg-red-100 text-red-800 dark:bg-gray-700 dark:text-gray-200'}"
|
|
>
|
|
{key.active ? 'Active' : 'Inactive'}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
{/each}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{:else}
|
|
<div class="flex flex-1 items-center justify-center">
|
|
<p class="text-lg text-gray-500 dark:text-gray-400">You don't have any license keys yet.</p>
|
|
</div>
|
|
{/if}
|
|
</div>
|