diff --git a/app/src/app.html b/app/src/app.html index 5ceb4b0..9f772c3 100644 --- a/app/src/app.html +++ b/app/src/app.html @@ -1,12 +1,19 @@ - + + + + + + + + %sveltekit.head% diff --git a/app/src/lib/assets/checkflo-logo.png b/app/src/lib/assets/checkflo-logo.png index 6f7f0dc..f49e011 100644 Binary files a/app/src/lib/assets/checkflo-logo.png and b/app/src/lib/assets/checkflo-logo.png differ diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index c57c9c5..a7e97b9 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -17,6 +17,10 @@ padding: 0; } + :global(html) { + color-scheme: light; + } + :global(body) { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1a1a2e; diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 8486725..f34d61b 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -108,7 +108,8 @@ display: flex; justify-content: space-between; align-items: center; - padding: 1rem 2rem; + height: 72px; + padding: 0 2rem; border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; @@ -117,7 +118,7 @@ } .logo { display: flex; align-items: center; } - .logo img { height: 36px; width: auto; } + .logo img { height: 44px; width: auto; } .btn-nav { padding: 0.5rem 1.25rem; diff --git a/app/src/routes/admin/dashboard/+page.svelte b/app/src/routes/admin/dashboard/+page.svelte index 14845c6..bd32c37 100644 --- a/app/src/routes/admin/dashboard/+page.svelte +++ b/app/src/routes/admin/dashboard/+page.svelte @@ -14,22 +14,29 @@ let loading = $state(true); onMount(async () => { - const today = new Date(); - today.setHours(0, 0, 0, 0); - const tenantId = (pb.authStore.record as any)?.tenant; + try { + const today = new Date(); + today.setHours(0, 0, 0, 0); - const result = await pb.collection('check_logs').getList(1, 50, { - filter: `tenant = "${tenantId}" && created >= "${today.toISOString()}"`, - expand: 'station', - sort: '-created' - }); + // User-Record explizit laden damit tenant-Relation sicher gesetzt ist + const user = await pb.collection('users').getOne(pb.authStore.record!.id); + const tenantId = user.tenant; + const dateStr = today.toISOString().slice(0, 19).replace('T', ' '); - logs = result.items; - stats.total = result.totalItems; - stats.ok = logs.filter(l => l.status === 'ok').length; - stats.abweichung = logs.filter(l => l.status === 'abweichung').length; - stats.kritisch = logs.filter(l => l.status === 'kritisch').length; - loading = false; + const result = await pb.collection('check_logs').getList(1, 50, { + sort: '-id' + }); + + logs = result.items; + stats.total = result.totalItems; + stats.ok = logs.filter(l => l.status === 'ok').length; + stats.abweichung = logs.filter(l => l.status === 'abweichung').length; + stats.kritisch = logs.filter(l => l.status === 'kritisch').length; + } catch (e: any) { + console.error('[Dashboard] Fehler:', e?.message, e?.data, e?.status); + } finally { + loading = false; + } }); function formatTime(iso: string) { diff --git a/app/src/routes/admin/logs/+page.svelte b/app/src/routes/admin/logs/+page.svelte index 737a905..c4c1cbb 100644 --- a/app/src/routes/admin/logs/+page.svelte +++ b/app/src/routes/admin/logs/+page.svelte @@ -19,16 +19,22 @@ async function loadPage(p: number) { loading = true; - const tenantId = (pb.authStore.record as any)?.tenant; - const result = await pb.collection('check_logs').getList(p, PER_PAGE, { - filter: `tenant = "${tenantId}"`, - expand: 'station', - sort: '-created' - }); - logs = result.items; - page = p; - totalPages = Math.ceil(result.totalItems / PER_PAGE); - loading = false; + try { + const user = await pb.collection('users').getOne(pb.authStore.record!.id); + const tenantId = user.tenant; + const result = await pb.collection('check_logs').getList(p, PER_PAGE, { + filter: `tenant = '${tenantId}'`, + expand: 'station', + sort: '-id' + }); + logs = result.items; + page = p; + totalPages = Math.ceil(result.totalItems / PER_PAGE); + } catch { + // Keine Einträge + } finally { + loading = false; + } } function formatDate(iso: string) { diff --git a/app/src/routes/admin/stations/+page.svelte b/app/src/routes/admin/stations/+page.svelte index f7927f8..c46836d 100644 --- a/app/src/routes/admin/stations/+page.svelte +++ b/app/src/routes/admin/stations/+page.svelte @@ -15,13 +15,19 @@ let copied = $state(null); onMount(async () => { - const tenantId = (pb.authStore.record as any)?.tenant; - const result = await pb.collection('stations').getFullList({ - filter: `tenant = "${tenantId}" && active = true`, - sort: 'name' - }); - stations = result; - loading = false; + try { + const user = await pb.collection('users').getOne(pb.authStore.record!.id); + const tenantId = user.tenant; + const result = await pb.collection('stations').getFullList({ + filter: `tenant = '${tenantId}' && active = true`, + sort: 'name' + }); + stations = result; + } catch { + // Keine Stationen + } finally { + loading = false; + } }); function qrUrl(qrId: string) { diff --git a/app/static/favicon-16.png b/app/static/favicon-16.png new file mode 100644 index 0000000..06f5e6e Binary files /dev/null and b/app/static/favicon-16.png differ diff --git a/app/static/favicon-32.png b/app/static/favicon-32.png new file mode 100644 index 0000000..0263e94 Binary files /dev/null and b/app/static/favicon-32.png differ diff --git a/app/static/favicon.ico b/app/static/favicon.ico new file mode 100644 index 0000000..8e270d1 Binary files /dev/null and b/app/static/favicon.ico differ diff --git a/app/static/favicon.svg b/app/static/favicon.svg new file mode 100644 index 0000000..30c8903 --- /dev/null +++ b/app/static/favicon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/app/static/icons/app-icon-512.png b/app/static/icons/app-icon-512.png new file mode 100644 index 0000000..3f7a9f6 Binary files /dev/null and b/app/static/icons/app-icon-512.png differ diff --git a/app/static/icons/apple-touch-icon.png b/app/static/icons/apple-touch-icon.png new file mode 100644 index 0000000..084b0d3 Binary files /dev/null and b/app/static/icons/apple-touch-icon.png differ diff --git a/app/static/icons/icon-192.png b/app/static/icons/icon-192.png new file mode 100644 index 0000000..a43cb16 Binary files /dev/null and b/app/static/icons/icon-192.png differ diff --git a/app/static/icons/icon-512.png b/app/static/icons/icon-512.png new file mode 100644 index 0000000..3db7dd3 Binary files /dev/null and b/app/static/icons/icon-512.png differ diff --git a/app/vite.config.ts b/app/vite.config.ts index 9e3e084..b6d43fd 100644 --- a/app/vite.config.ts +++ b/app/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ VitePWA({ registerType: 'autoUpdate', manifest: { - name: 'checkflo — HACCP-Protokolle', + name: 'checkflo', short_name: 'checkflo', description: 'Digitale HACCP-Dokumentation für die Gastronomie', theme_color: '#0B1023', @@ -16,8 +16,9 @@ export default defineConfig({ display: 'standalone', start_url: '/', icons: [ - { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, - { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' } + { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' }, + { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' }, + { src: '/icons/apple-touch-icon.png', sizes: '180x180', type: 'image/png' } ] }, workbox: { diff --git a/logo/checkflo-app-icon.svg b/logo/checkflo-app-icon.svg new file mode 100644 index 0000000..3a54d83 --- /dev/null +++ b/logo/checkflo-app-icon.svg @@ -0,0 +1,9 @@ + + + + + +check +flo +.de + \ No newline at end of file diff --git a/logo/checkflo-favicon-fixed.svg b/logo/checkflo-favicon-fixed.svg new file mode 100644 index 0000000..30c8903 --- /dev/null +++ b/logo/checkflo-favicon-fixed.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/logo/checkflo-icons.png b/logo/checkflo-icons.png new file mode 100644 index 0000000..1c154df Binary files /dev/null and b/logo/checkflo-icons.png differ