diff --git a/apps/dispatch/app/_components/map/ContextMenu.tsx b/apps/dispatch/app/_components/map/ContextMenu.tsx index e8c3bf54..e7a12067 100644 --- a/apps/dispatch/app/_components/map/ContextMenu.tsx +++ b/apps/dispatch/app/_components/map/ContextMenu.tsx @@ -59,16 +59,17 @@ export const ContextMenu = () => { const addOSMobjects = async (ignorePreviosSelected?: boolean) => { const res = await fetch( `https://overpass-api.de/api/interpreter?data=${encodeURIComponent(` - [out:json]; - ( - way["building"](around:100, ${contextMenu.lat}, ${contextMenu.lng}); - relation["building"](around:100, ${contextMenu.lat}, ${contextMenu.lng}); - ); - out body; - >; - out skel qt; - `)}`, + [out:json]; + ( + way["leisure"~"pitch|sports_centre"](around:2000, ${contextMenu.lat}, ${contextMenu.lng}); + relation["leisure"~"pitch|sports_centre"](around:2000, ${contextMenu.lat}, ${contextMenu.lng}); + ); + out body; + >; + out skel qt; + `)}`, ); + const data = await res.json(); const parsed: OSMWay[] = data.elements .filter((e: any) => e.type === "way") diff --git a/apps/docs/.dockerignore b/apps/docs/.dockerignore new file mode 100644 index 00000000..76add878 --- /dev/null +++ b/apps/docs/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/apps/docs/Dockerfile b/apps/docs/Dockerfile new file mode 100644 index 00000000..c89b3760 --- /dev/null +++ b/apps/docs/Dockerfile @@ -0,0 +1,32 @@ +# --- Build stage --- +FROM node:24-alpine3.21 AS builder +# Consider using the latest patch version for security updates +RUN apk update && apk upgrade + +# Install pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate +RUN apk add --no-cache git + +# Set workdir +WORKDIR /app + +# Copy project files +COPY ./apps/docs . + +# Install dependencies +RUN pnpm install + +# Build VitePress site +RUN pnpm build + +# --- Serve stage --- +FROM nginx:alpine + +# Copy built site to nginx public folder +COPY --from=builder /app/.vitepress/dist /usr/share/nginx/html + +# Expose port +EXPOSE 80 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/hub/app/(app)/_components/Penalty.tsx b/apps/hub/app/(app)/_components/Penalty.tsx index 2e64e1b7..f3f1fc61 100644 --- a/apps/hub/app/(app)/_components/Penalty.tsx +++ b/apps/hub/app/(app)/_components/Penalty.tsx @@ -1,46 +1,55 @@ import { getPublicUser, prisma } from "@repo/db"; import { TriangleAlert } from "lucide-react"; -import { getServerSession } from "next-auth"; import { PenaltyCountdown } from "./PenaltyCountdown"; +import { getServerSession } from "api/auth/[...nextauth]/auth"; export const Penalty = async () => { const session = await getServerSession(); - const openPenaltys = await prisma.penalty.findMany({ + const openTimeban = await prisma.penalty.findMany({ where: { userId: session?.user.id, until: { gte: new Date(), }, suspended: false, - - type: { in: ["TIME_BAN", "BAN"] }, + type: { in: ["TIME_BAN"] }, }, include: { CreatedUser: true, }, }); - if (!openPenaltys[0]) { - return null; - } + + const openBans = await prisma.penalty.findMany({ + where: { + userId: session?.user.id, + suspended: false, + type: { in: ["BAN"] }, + }, + include: { + CreatedUser: true, + }, + }); + + console.log("Open Penaltys:", session); return (
Du hast eine aktive Strafe und kannst dich deshalb nicht mit dem Netzwerk verbinden.
- Grund: {openPenaltys[0].reason} + Grund: {openTimeban[0].reason}
Admin:{" "} - {getPublicUser(openPenaltys[0].CreatedUser).fullName} + {getPublicUser(openTimeban[0].CreatedUser).fullName}
Grund: {openPenaltys[0].reason}
-- Admin:{" "} - {getPublicUser(openPenaltys[0].CreatedUser).fullName} -
+ {openBans[0] && ( + <> ++ Grund: {openBans[0].reason || "Keine Begründung gefunden"} +
++ Admin:{" "} + {getPublicUser(openBans[0].CreatedUser).fullName || "Keine Admin gefunden"} +
+ > + )}