feat(frontend): scaffold Nuxt 3 CSR SPA with full auth + client/history UI
- Nuxt 3 CSR (ssr:false), @nuxtjs/tailwindcss, dev proxy to backend
- useAuth composable: CSRF cookie, XSRF token, login/logout/fetchUser
- auth middleware: redirects to /login if no session
- Login page, client list with search + create modal
- Client detail with editable name, dynamic notes (JSON), history feed
- History form with type select, inline edit/delete per entry
- Print layout at /clients/:id/print (calls window.print on mount)
- TypeScript interfaces: User, Client, HistoryEntry, PaginatedResponse
- German UI labels throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 10:33:39 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import type { Client } from '~/types'
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ client: Client }>()
|
feat(frontend): commit uncommitted settings, custom fields, and import work
This local working tree had accumulated a substantial amount of
finished-but-never-committed frontend work: custom client fields
(replacing the old static ClientFields with a dynamic
ClientCustomFieldCard + useCustomFields), CSV import
(useImport + settings/import page), history type management
(useHistoryTypes + settings/history-types page), an admin-only route
middleware, several new icon components, a shared useApiFetch
composable, and a client detail page restructure ([id].vue ->
[id]/index.vue). None of it had ever been pushed, so production was
running a stale build that was already linking to routes/components
that didn't exist server-side (missing IconSettings, 404s on
/settings/import, etc). This commit brings the repo in line with
local state.
2026-07-18 09:27:19 +00:00
|
|
|
|
|
|
|
|
const daysAgo = (iso: string): number => {
|
|
|
|
|
const diffMs = Date.now() - new Date(iso).getTime()
|
|
|
|
|
return Math.max(0, Math.floor(diffMs / 86_400_000))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const info = computed(() => {
|
|
|
|
|
const count = props.client.history_count
|
|
|
|
|
if (count == null || count === 0) return null
|
|
|
|
|
|
|
|
|
|
const updates = `${count} Verlauf-Update${count > 1 ? 's' : ''}`
|
|
|
|
|
const last = props.client.last_history_at
|
|
|
|
|
if (!last) return updates
|
|
|
|
|
|
|
|
|
|
const d = daysAgo(last)
|
|
|
|
|
const when =
|
|
|
|
|
d === 0 ? 'heute' : `vor ${d} ${d === 1 ? 'Tag' : 'Tagen'}`
|
|
|
|
|
return `${updates} · zuletzt ${when}`
|
|
|
|
|
})
|
feat(frontend): scaffold Nuxt 3 CSR SPA with full auth + client/history UI
- Nuxt 3 CSR (ssr:false), @nuxtjs/tailwindcss, dev proxy to backend
- useAuth composable: CSRF cookie, XSRF token, login/logout/fetchUser
- auth middleware: redirects to /login if no session
- Login page, client list with search + create modal
- Client detail with editable name, dynamic notes (JSON), history feed
- History form with type select, inline edit/delete per entry
- Print layout at /clients/:id/print (calls window.print on mount)
- TypeScript interfaces: User, Client, HistoryEntry, PaginatedResponse
- German UI labels throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 10:33:39 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<NuxtLink
|
|
|
|
|
:to="`/clients/${client.id}`"
|
|
|
|
|
class="block border border-gray-200 bg-white px-4 py-3 hover:bg-blue-50 cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
<div class="flex items-baseline gap-4">
|
|
|
|
|
<span class="text-sm font-mono text-gray-500 w-20 shrink-0">{{ client.client_number }}</span>
|
|
|
|
|
<span class="text-sm font-medium text-gray-900">{{ client.name }}</span>
|
|
|
|
|
</div>
|
feat(frontend): commit uncommitted settings, custom fields, and import work
This local working tree had accumulated a substantial amount of
finished-but-never-committed frontend work: custom client fields
(replacing the old static ClientFields with a dynamic
ClientCustomFieldCard + useCustomFields), CSV import
(useImport + settings/import page), history type management
(useHistoryTypes + settings/history-types page), an admin-only route
middleware, several new icon components, a shared useApiFetch
composable, and a client detail page restructure ([id].vue ->
[id]/index.vue). None of it had ever been pushed, so production was
running a stale build that was already linking to routes/components
that didn't exist server-side (missing IconSettings, 404s on
/settings/import, etc). This commit brings the repo in line with
local state.
2026-07-18 09:27:19 +00:00
|
|
|
<p v-if="info" class="mt-1 pl-24 text-xs text-gray-400">{{ info }}</p>
|
feat(frontend): scaffold Nuxt 3 CSR SPA with full auth + client/history UI
- Nuxt 3 CSR (ssr:false), @nuxtjs/tailwindcss, dev proxy to backend
- useAuth composable: CSRF cookie, XSRF token, login/logout/fetchUser
- auth middleware: redirects to /login if no session
- Login page, client list with search + create modal
- Client detail with editable name, dynamic notes (JSON), history feed
- History form with type select, inline edit/delete per entry
- Print layout at /clients/:id/print (calls window.print on mount)
- TypeScript interfaces: User, Client, HistoryEntry, PaginatedResponse
- German UI labels throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 10:33:39 +00:00
|
|
|
</NuxtLink>
|
|
|
|
|
</template>
|