Now even prettier with the new Tailwind CSS plugin. Probably should have done this long ago...

This commit is contained in:
Scott Idem
2026-03-24 12:11:25 -04:00
parent 9a75243d9c
commit e9379be5a1
22 changed files with 615 additions and 615 deletions

View File

@@ -77,11 +77,11 @@ async function handle_add_user() {
}
</script>
<div class="container mx-auto p-4 space-y-6">
<div class="container mx-auto space-y-6 p-4">
<header
class="flex justify-between items-center bg-surface-50-900-token p-4 rounded-xl shadow-lg border border-surface-500/10">
class="bg-surface-50-900-token border-surface-500/10 flex items-center justify-between rounded-xl border p-4 shadow-lg">
<div class="flex items-center gap-2">
<div class="p-2 bg-primary-500/10 rounded-lg">
<div class="bg-primary-500/10 rounded-lg p-2">
<ShieldCheck size={24} class="text-primary-500" />
</div>
<h1 class="h2 font-black tracking-tight">User Management</h1>
@@ -98,45 +98,45 @@ async function handle_add_user() {
</header>
<div
class="card p-6 shadow-xl preset-tonal-surface border border-surface-500/10 space-y-4">
<div class="flex flex-wrap gap-6 items-end">
<div class="flex-1 min-w-[280px] space-y-1">
class="card preset-tonal-surface border-surface-500/10 space-y-4 border p-6 shadow-xl">
<div class="flex flex-wrap items-end gap-6">
<div class="min-w-[280px] flex-1 space-y-1">
<span
class="label block text-xs font-bold opacity-75 uppercase tracking-wider ml-1"
class="label ml-1 block text-xs font-bold tracking-wider uppercase opacity-75"
>Search Users</span>
<div
class="flex bg-surface-200-700-token rounded-lg overflow-hidden border border-surface-500/20 shadow-inner group focus-within:ring-2 focus-within:ring-primary-500/50 transition-all">
class="bg-surface-200-700-token border-surface-500/20 group focus-within:ring-primary-500/50 flex overflow-hidden rounded-lg border shadow-inner transition-all focus-within:ring-2">
<div
class="flex items-center justify-center px-4 bg-surface-300-600-token border-r border-surface-500/20">
class="bg-surface-300-600-token border-surface-500/20 flex items-center justify-center border-r px-4">
<Search size={18} class="opacity-50" />
</div>
<input
class="bg-transparent border-0 ring-0 focus:ring-0 p-3 grow placeholder:opacity-50"
class="grow border-0 bg-transparent p-3 ring-0 placeholder:opacity-50 focus:ring-0"
type="search"
bind:value={qry_str}
placeholder="Search username or email..."
onkeydown={(e) => e.key === 'Enter' && load_users()} />
<button
class="preset-filled-primary font-bold px-10 py-3 hover:brightness-110 transition-all border-l border-surface-500/20 flex items-center justify-center min-w-[100px]"
class="preset-filled-primary border-surface-500/20 flex min-w-[100px] items-center justify-center border-l px-10 py-3 font-bold transition-all hover:brightness-110"
onclick={load_users}
disabled={loading}>
{#if loading}
<span class="animate-spin text-xl"></span>
{:else}
<span class="whitespace-nowrap tracking-wide"
<span class="tracking-wide whitespace-nowrap"
>Go</span>
{/if}
</button>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div class="space-y-1">
<span
class="label block text-xs font-bold opacity-75 uppercase tracking-wider ml-1"
class="label ml-1 block text-xs font-bold tracking-wider uppercase opacity-75"
>Scope</span>
<select
class="select preset-filled-surface rounded-lg text-sm border border-surface-500/20 p-2"
class="select preset-filled-surface border-surface-500/20 rounded-lg border p-2 text-sm"
bind:value={qry_account_scope}
onchange={load_users}>
<option value="all">All (Current + Global)</option>
@@ -147,10 +147,10 @@ async function handle_add_user() {
<div class="space-y-1">
<span
class="label block text-xs font-bold opacity-75 uppercase tracking-wider ml-1"
class="label ml-1 block text-xs font-bold tracking-wider uppercase opacity-75"
>Status</span>
<select
class="select preset-filled-surface rounded-lg text-sm border border-surface-500/20 p-2"
class="select preset-filled-surface border-surface-500/20 rounded-lg border p-2 text-sm"
bind:value={qry_enabled}
onchange={load_users}>
<option value="all">All</option>
@@ -163,38 +163,38 @@ async function handle_add_user() {
</div>
{#if loading}
<div class="card p-8 flex justify-center items-center h-64">
<div class="placeholder animate-pulse w-full h-full rounded-2xl">
<div class="card flex h-64 items-center justify-center p-8">
<div class="placeholder h-full w-full animate-pulse rounded-2xl">
</div>
</div>
{:else if user_li.length === 0}
<div
class="card p-12 text-center preset-tonal-surface border-2 border-dashed border-surface-500/20 rounded-2xl">
class="card preset-tonal-surface border-surface-500/20 rounded-2xl border-2 border-dashed p-12 text-center">
<Fingerprint size={48} class="mx-auto mb-4 opacity-20" />
<h3 class="h3 font-bold opacity-50">No Users Found</h3>
<p class="opacity-60 max-w-xs mx-auto mt-2">
<p class="mx-auto mt-2 max-w-xs opacity-60">
Try adjusting your search or scope filters.
</p>
</div>
{:else}
<div
class="card p-6 preset-tonal-surface shadow-xl border border-surface-500/10">
class="card preset-tonal-surface border-surface-500/10 border p-6 shadow-xl">
<h3
class="h4 font-bold border-b border-surface-500/30 pb-2 mb-6 flex items-center gap-2">
class="h4 border-surface-500/30 mb-6 flex items-center gap-2 border-b pb-2 font-bold">
<ListFilter size={18} class="text-secondary-500" />
Directory Results
<span class="badge preset-tonal-secondary ml-auto"
>{user_li.length} found</span>
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
{#each user_li as user (user.user_id_random)}
<div
class="card p-5 space-y-4 preset-tonal-surface shadow-md border border-surface-500/10 hover:border-primary-500/30 transition-all group">
<header class="flex justify-between items-start">
class="card preset-tonal-surface border-surface-500/10 hover:border-primary-500/30 group space-y-4 border p-5 shadow-md transition-all">
<header class="flex items-start justify-between">
<div class="flex items-center gap-3">
<div
class="avatar preset-filled-primary w-12 h-12 flex items-center justify-center rounded-full shadow-inner group-hover:scale-110 transition-transform">
class="avatar preset-filled-primary flex h-12 w-12 items-center justify-center rounded-full shadow-inner transition-transform group-hover:scale-110">
<User size={24} />
</div>
<div>
@@ -202,7 +202,7 @@ async function handle_add_user() {
{user.username}
</p>
<p
class="text-[10px] uppercase font-bold opacity-50">
class="text-[10px] font-bold uppercase opacity-50">
{user.name || 'No Display Name'}
</p>
</div>
@@ -210,21 +210,21 @@ async function handle_add_user() {
<div class="flex flex-col items-end gap-1">
{#if user.super}
<span
class="badge preset-filled-error text-[8px] uppercase font-bold"
class="badge preset-filled-error text-[8px] font-bold uppercase"
>Super</span>
{:else if user.manager}
<span
class="badge preset-filled-warning text-[8px] uppercase font-bold"
class="badge preset-filled-warning text-[8px] font-bold uppercase"
>Manager</span>
{/if}
{#if !user.account_id && !user.account_id_random}
<span
class="badge preset-tonal-secondary text-[8px] uppercase font-bold flex items-center gap-1">
class="badge preset-tonal-secondary flex items-center gap-1 text-[8px] font-bold uppercase">
<Globe size={8} /> Global
</span>
{:else}
<span
class="badge preset-tonal-primary text-[8px] uppercase font-bold flex items-center gap-1">
class="badge preset-tonal-primary flex items-center gap-1 text-[8px] font-bold uppercase">
<Landmark size={8} /> Account
</span>
{/if}
@@ -233,13 +233,13 @@ async function handle_add_user() {
<div class="space-y-2">
<div
class="flex items-center gap-2 text-xs opacity-70 bg-black/5 p-2 rounded-lg">
class="flex items-center gap-2 rounded-lg bg-black/5 p-2 text-xs opacity-70">
<Mail size={14} class="text-primary-500" />
<span class="truncate"
>{user.email || '--'}</span>
</div>
<div
class="flex items-center gap-2 text-xs opacity-70 bg-black/5 p-2 rounded-lg">
class="flex items-center gap-2 rounded-lg bg-black/5 p-2 text-xs opacity-70">
<Activity
size={14}
class="text-secondary-500" />
@@ -249,7 +249,7 @@ async function handle_add_user() {
</div>
<a
class="btn btn-sm preset-filled-primary font-bold w-full shadow-lg group-hover:brightness-110 transition-all"
class="btn btn-sm preset-filled-primary w-full font-bold shadow-lg transition-all group-hover:brightness-110"
href="/core/users/{user.user_id_random}">
Manage User
</a>