diff --git a/Dockerfile b/Dockerfile index da2993e..cd1ef18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,9 @@ COPY --from=install /temp/dev/node_modules node_modules COPY . . # [optional] tests & build -ENV NODE_ENV=production -RUN bun test -RUN bun run build +#ENV NODE_ENV=production +#RUN bun test +#RUN bun run build # copy production dependencies and source code into final image FROM base AS release diff --git a/web/Dockerfile b/web/Dockerfile index c1ae596..0da3d1a 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,7 +1,7 @@ FROM node:22-alpine AS builder WORKDIR /app COPY package*.json ./ -RUN npm ci +RUN npm i COPY . . RUN npm run build RUN npm prune --production @@ -13,4 +13,4 @@ COPY --from=builder /app/node_modules node_modules/ COPY package.json . EXPOSE 3000 ENV NODE_ENV=production -CMD [ "node", "build" ] \ No newline at end of file +CMD [ "node", "build" ] diff --git a/web/src/app.html b/web/src/app.html index b666c1a..f273cc5 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -1,5 +1,5 @@ - + diff --git a/web/src/lib/ws.svelte.ts b/web/src/lib/ws.svelte.ts index a8e2681..61cb056 100644 --- a/web/src/lib/ws.svelte.ts +++ b/web/src/lib/ws.svelte.ts @@ -21,7 +21,7 @@ eventTarget.addEventListener("send", (e) => { }); export function connectWS() { - ws = new WebSocket(`ws://localhost:3000`); + ws = new WebSocket(`ws://${location.hostname}:3000`); console.log("Connecting to WebSocket..."); ws.addEventListener("open", () => { @@ -54,4 +54,4 @@ export function connectWS() { console.log("Received message:", data); eventTarget.dispatchEvent(new CustomEvent(data.type, { detail: data })); }); -} \ No newline at end of file +} diff --git a/web/src/routes/(manage)/+layout.svelte b/web/src/routes/(manage)/+layout.svelte index 0af1289..121211c 100644 --- a/web/src/routes/(manage)/+layout.svelte +++ b/web/src/routes/(manage)/+layout.svelte @@ -11,6 +11,7 @@ import ConnectionLostDialog from '$lib/ConnectionLostDialog.svelte'; import { onMount } from 'svelte'; import { browser } from '$app/environment'; + import { sidebarState } from "$lib/sidebar.svelte.ts"; let { children } = $props(); @@ -40,7 +41,7 @@ - + diff --git a/web/src/routes/(manage)/log/+page.svelte b/web/src/routes/(manage)/log/+page.svelte index 39fe9ab..2efb8ce 100644 --- a/web/src/routes/(manage)/log/+page.svelte +++ b/web/src/routes/(manage)/log/+page.svelte @@ -3,6 +3,7 @@ import { eventTarget } from "$lib/ws.svelte"; import { TicketCheckIcon, TicketIcon, TicketSlashIcon, TicketXIcon } from "@lucide/svelte"; import { onMount } from "svelte"; + import { sidebarState } from "$lib/sidebar.svelte.ts"; type LogAction = "called" | "completed" | "no-show"; const colors = { @@ -40,7 +41,9 @@ }) -

Log

+

{ + sidebarState.open = !sidebarState.open; +}}>Log

@@ -65,4 +68,4 @@ {/each} - \ No newline at end of file + diff --git a/web/src/routes/(manage)/room/[slug]/+page.svelte b/web/src/routes/(manage)/room/[slug]/+page.svelte index e831c45..06f4b0e 100644 --- a/web/src/routes/(manage)/room/[slug]/+page.svelte +++ b/web/src/routes/(manage)/room/[slug]/+page.svelte @@ -4,6 +4,7 @@ import * as InputOTP from "$lib/components/ui/input-otp"; import { eventTarget } from "$lib/ws.svelte"; import { toast } from "svelte-sonner"; + import { sidebarState } from "$lib/sidebar.svelte.ts"; const slug = $derived(page.params.slug); @@ -82,7 +83,9 @@ }) -

Raum {slug}

+

{ + sidebarState.open = !sidebarState.open; +}}>Raum {slug}

{ isInvalid = false; @@ -132,4 +135,4 @@ #ticket { display: flex; } - \ No newline at end of file + diff --git a/web/src/routes/display/+page.svelte b/web/src/routes/display/+page.svelte index 94f411c..7f14f70 100644 --- a/web/src/routes/display/+page.svelte +++ b/web/src/routes/display/+page.svelte @@ -23,21 +23,42 @@ eventTarget.dispatchEvent(new CustomEvent("send", { detail: { type: "display" } })); }) + + const ENTRIES = {A: 1, B: 2, C: 1, D: 2, E: 1}; -
-

Aufruf

+
+ {#if connected} - + + - {#each calls as call (call.num)} + {#each calls.filter(c => c.num.startsWith("A")) as call (call.num)} - + + + + {/each} + +
TicketWartenr.-> Raum
{call.num}{call.ticket.status === "no-show" ? "Empfang " + (call.num.startsWith("A") ? "1" : "2") : call.ticket.room}->{call.ticket.status === "no-show" ? "Empfang " + ENTRIES[call.num[0]] : call.ticket.room}
+ + + + + + + + + {#each calls.filter(c => c.num.startsWith("B")) as call (call.num)} + + + + {/each} @@ -47,13 +68,15 @@
Wartenr.->Raum
{call.num}->{call.ticket.status === "no-show" ? "Empfang " + ENTRIES[call.num[0]] : call.ticket.room}