Rebrand Hub+Flux
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run

This commit is contained in:
Kevin Adametz 2026-05-20 15:44:15 +02:00
parent 0a3e52d603
commit 9b47296cea
130 changed files with 9357 additions and 3345 deletions

View file

@ -85,76 +85,107 @@ new #[Layout('components.layouts.app'), Title('API-Tokens')] class extends Compo
}
}; ?>
<div class="space-y-6">
<flux:card>
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<flux:heading size="lg">{{ __('API-Tokens') }}</flux:heading>
<flux:subheading>{{ __('Erstellen und widerrufen Sie persönliche Tokens für die neue API v1.') }}</flux:subheading>
<div class="space-y-8">
{{-- ============== PAGE HEADER ============== --}}
<header class="grid items-end gap-8" style="grid-template-columns:1fr auto;">
<div class="min-w-0">
<div class="flex items-center gap-3 mb-3 flex-wrap">
<span class="badge hub dot">{{ __('User Backend') }}</span>
<span class="eyebrow muted">{{ __('Mein Bereich · API') }}</span>
</div>
<flux:button href="{{ route('docs.api.v1') }}" variant="subtle">
<h1 class="text-[30px] font-bold tracking-[-0.6px] leading-[1.15] m-0 text-[color:var(--color-ink)]">
{{ __('API-Tokens') }}
</h1>
<p class="text-[13px] leading-[1.55] mt-2 m-0 max-w-[640px] text-[color:var(--color-ink-2)]">
{{ __('Erstellen und widerrufen Sie persönliche Tokens für die neue API v1.') }}
</p>
</div>
<div class="flex items-center gap-2 flex-shrink-0">
<flux:button href="{{ route('docs.api.v1') }}" variant="ghost" icon="book-open">
{{ __('API-Dokumentation') }}
</flux:button>
</div>
</flux:card>
</header>
@if($notification)
<flux:callout color="green" icon="check-circle">
@if ($notification)
<div class="px-4 py-3 rounded-[5px] border text-[12.5px] flex items-center gap-2
bg-[color:var(--color-ok-soft)] border-[color:var(--color-ok)]/30 text-[color:var(--color-gain-deep)]">
<flux:icon.check-circle class="size-[16px] flex-shrink-0" />
{{ $notification }}
</flux:callout>
</div>
@endif
@if($eligibilityMessage || $apiTokenDenialReason)
<flux:callout color="yellow" icon="lock-closed">
{{ $eligibilityMessage ?? $apiTokenDenialReason }}
</flux:callout>
@if ($eligibilityMessage || $apiTokenDenialReason)
<div class="px-4 py-3 rounded-[5px] border text-[12.5px] flex items-start gap-3
bg-[color:var(--color-warn-soft)] border-[color:var(--color-warn)]/30 text-[color:var(--color-ink-2)]">
<flux:icon.lock-closed class="size-[16px] flex-shrink-0 mt-0.5 text-[color:var(--color-accent-deep)]" />
<div class="flex-1">{{ $eligibilityMessage ?? $apiTokenDenialReason }}</div>
</div>
@endif
@if($plainTextToken)
<flux:callout color="yellow" icon="key">
<div class="space-y-3">
<flux:text weight="semibold">{{ __('Neuer Token') }}</flux:text>
<code class="block overflow-x-auto rounded-md bg-zinc-950 px-3 py-2 text-sm text-white">{{ $plainTextToken }}</code>
@if ($plainTextToken)
<article class="panel" style="border-left:3px solid var(--color-warn);">
<div class="panel-head">
<span class="section-eyebrow">{{ __('Neuer Token') }}</span>
<span class="badge warn">{{ __('Nur jetzt sichtbar') }}</span>
</div>
</flux:callout>
<div class="p-5 space-y-3">
<p class="text-[12.5px] text-[color:var(--color-ink-2)] m-0">
{{ __('Bitte kopieren Sie ihn jetzt, er wird später nicht erneut angezeigt.') }}
</p>
{{-- Token-Anzeige: dunkler Hintergrund konstant in Light + Dark
(deshalb panel-dark-2 statt --color-ink, das im Dark Mode hell wird). --}}
<code class="block overflow-x-auto rounded-[5px] bg-[color:var(--color-panel-dark-2)] px-3 py-2 text-[12px] text-white font-mono">{{ $plainTextToken }}</code>
</div>
</article>
@endif
{{-- ============== FORM-PANEL ============== --}}
<form wire:submit="createToken">
<flux:card class="space-y-5">
<div>
<flux:heading size="sm">{{ __('Neuen Token erstellen') }}</flux:heading>
<flux:text class="mt-1 text-sm text-zinc-500">
<article class="panel">
<div class="panel-head">
<span class="section-eyebrow">{{ __('Neuen Token erstellen') }}</span>
</div>
<div class="p-5 space-y-5">
<p class="text-[12.5px] text-[color:var(--color-ink-3)] m-0">
{{ __('Wählen Sie nur die Berechtigungen aus, die der jeweilige API-Client wirklich benötigt.') }}
</flux:text>
</div>
</p>
<flux:field>
<flux:label>{{ __('Name') }}</flux:label>
<flux:input wire:model="tokenName" placeholder="{{ __('z.B. Website-Integration') }}" />
<flux:error name="tokenName" />
</flux:field>
<flux:field>
<flux:label>{{ __('Name') }}</flux:label>
<flux:input wire:model="tokenName" placeholder="{{ __('z.B. Website-Integration') }}" />
<flux:error name="tokenName" />
</flux:field>
<div>
<flux:label>{{ __('Berechtigungen') }}</flux:label>
<div class="mt-3 grid gap-3 md:grid-cols-2">
@foreach($abilityOptions as $ability => $label)
<flux:checkbox wire:model="selectedAbilities" value="{{ $ability }}" label="{{ $label }}" />
@endforeach
<div>
<flux:label>{{ __('Berechtigungen') }}</flux:label>
<div class="mt-3 grid gap-3 md:grid-cols-2">
@foreach ($abilityOptions as $ability => $label)
<flux:checkbox wire:model="selectedAbilities" value="{{ $ability }}" label="{{ $label }}" />
@endforeach
</div>
<flux:error name="selectedAbilities" class="mt-3" />
</div>
<flux:error name="selectedAbilities" class="mt-3" />
</div>
<div class="flex justify-end">
<flux:button type="submit" variant="primary" icon="key" :disabled="! $canCreateApiToken">
{{ __('Token erstellen') }}
</flux:button>
<div class="flex justify-end pt-3 border-t border-[color:var(--color-bg-rule)]">
<flux:button type="submit" variant="primary" icon="key" :disabled="! $canCreateApiToken">
{{ __('Token erstellen') }}
</flux:button>
</div>
</div>
</flux:card>
</article>
</form>
<flux:card class="p-0">
<div class="p-4">
<flux:table>
{{-- ============== TABELLE ============== --}}
<article class="panel overflow-hidden">
<div class="panel-head">
<span class="section-eyebrow">{{ __('Bestehende Tokens') }}</span>
<span class="text-[11.5px] text-[color:var(--color-ink-3)]">
{{ __(':count Einträge', ['count' => $tokens->count()]) }}
</span>
</div>
<flux:table>
<flux:table.columns>
<flux:table.column>{{ __('Name') }}</flux:table.column>
<flux:table.column>{{ __('Berechtigungen') }}</flux:table.column>
@ -163,23 +194,27 @@ new #[Layout('components.layouts.app'), Title('API-Tokens')] class extends Compo
<flux:table.column>{{ __('Aktionen') }}</flux:table.column>
</flux:table.columns>
@forelse($tokens as $token)
@forelse ($tokens as $token)
<flux:table.row wire:key="token-{{ $token->id }}">
<flux:table.cell>
<flux:text weight="semibold">{{ $token->name }}</flux:text>
<span class="text-[13px] font-semibold text-[color:var(--color-ink)]">{{ $token->name }}</span>
</flux:table.cell>
<flux:table.cell>
<div class="flex flex-wrap gap-1">
@foreach($token->abilities ?? [] as $ability)
<flux:badge size="sm" color="zinc">{{ $ability }}</flux:badge>
@foreach ($token->abilities ?? [] as $ability)
<span class="badge hub">{{ $ability }}</span>
@endforeach
</div>
</flux:table.cell>
<flux:table.cell>
<flux:text class="text-sm text-zinc-500">{{ $token->created_at?->format('d.m.Y H:i') }}</flux:text>
<span class="text-[12px] text-[color:var(--color-ink-3)]">
{{ $token->created_at?->format('d.m.Y H:i') }}
</span>
</flux:table.cell>
<flux:table.cell>
<flux:text class="text-sm text-zinc-500">{{ $token->last_used_at?->format('d.m.Y H:i') ?? __('Nie') }}</flux:text>
<span class="text-[12px] text-[color:var(--color-ink-3)]">
{{ $token->last_used_at?->format('d.m.Y H:i') ?? __('Nie') }}
</span>
</flux:table.cell>
<flux:table.cell>
<flux:button
@ -197,16 +232,20 @@ new #[Layout('components.layouts.app'), Title('API-Tokens')] class extends Compo
<flux:table.row>
<flux:table.cell colspan="5">
<div class="flex flex-col items-center justify-center px-4 py-10 text-center">
<flux:icon.key class="size-10 text-zinc-300" />
<flux:text weight="semibold" class="mt-3">{{ __('Keine API-Tokens vorhanden') }}</flux:text>
<flux:text class="mt-1 max-w-md text-sm text-zinc-500">
<div class="w-14 h-14 rounded-[6px] flex items-center justify-center mb-3
bg-[color:var(--color-hub-soft)] border border-[color:var(--color-hub-soft-2)] text-[color:var(--color-hub)]">
<flux:icon.key class="size-6" />
</div>
<div class="text-[14px] font-semibold text-[color:var(--color-ink)] mb-1">
{{ __('Keine API-Tokens vorhanden') }}
</div>
<p class="text-[12px] text-[color:var(--color-ink-3)] max-w-md m-0">
{{ __('Erstellen Sie erst dann einen Token, wenn eine konkrete API-Integration ihn benötigt.') }}
</flux:text>
</p>
</div>
</flux:table.cell>
</flux:table.row>
@endforelse
</flux:table>
</div>
</flux:card>
</flux:table>
</article>
</div>