feat: add hub

This commit is contained in:
2026-10-03 23:57:41 +02:00
parent 5452f72087
commit fb7b560696
52 changed files with 290 additions and 162 deletions
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
// The buttons in every app's header: back to the hub and light / dark. One size and style everywhere; don't override it.
withDefaults(defineProps<{ hubLink?: boolean }>(), { hubLink: true })
</script>
<template>
<div class="flex shrink-0 items-center gap-1 print:hidden">
<UButton v-if="hubLink" to="/" icon="i-lucide-house" color="neutral" variant="ghost" aria-label="Zur Übersicht" title="huaqo.de" />
<UColorModeButton color="neutral" variant="ghost" />
</div>
</template>
+4 -4
View File
@@ -14,7 +14,7 @@ async function unlock() {
await $fetch('/api/auth/login', { method: 'POST', body: { password: password.value } })
emit('unlocked')
} catch (e) {
error.value = errorMessage(e) ?? 'Couldn\'t unlock'
error.value = errorMessage(e) ?? 'Entsperren fehlgeschlagen'
password.value = ''
} finally {
unlocking.value = false
@@ -23,13 +23,13 @@ async function unlock() {
</script>
<template>
<UModal :open="true" :dismissible="false" :close="false" :title="title" description="Enter your password to continue.">
<UModal :open="true" :dismissible="false" :close="false" :title="title" description="Passwort eingeben, um fortzufahren.">
<template #body>
<form class="space-y-4" @submit.prevent="unlock">
<UFormField label="Password" :error="error">
<UFormField label="Passwort" :error="error">
<UInput v-model="password" type="password" autocomplete="current-password" class="w-full" autofocus />
</UFormField>
<UButton type="submit" label="Unlock" icon="i-lucide-lock-open" :loading="unlocking" :disabled="!password" />
<UButton type="submit" label="Entsperren" icon="i-lucide-lock-open" :loading="unlocking" :disabled="!password" />
</form>
</template>
</UModal>