diff --git a/app/settings/co2-galvo/[id]/page.tsx b/app/settings/co2-galvo/[id]/page.tsx index ca7459f4..a2bf90b2 100644 --- a/app/settings/co2-galvo/[id]/page.tsx +++ b/app/settings/co2-galvo/[id]/page.tsx @@ -1,11 +1,12 @@ +// app/settings/co2-galvo/[id]/co2-galvo.tsx "use client"; import { useParams, useSearchParams } from "next/navigation"; import CO2GalvoDetail from "@/components/details/CO2GalvoDetail"; -export default function CO2GalvoDetailStandalone() { - const params = useParams<{ id: string }>(); +export default function CO2GalvoSettingDetailPage() { + const { id } = useParams<{ id: string }>(); const sp = useSearchParams(); const edit = sp.get("edit") === "1"; - return ; + return ; } diff --git a/components/details/CO2GalvoDetail.tsx b/components/details/CO2GalvoDetail.tsx index dc96ba3c..6760facf 100644 --- a/components/details/CO2GalvoDetail.tsx +++ b/components/details/CO2GalvoDetail.tsx @@ -1,3 +1,4 @@ +// components/details/CO2GalvoDetail.tsx "use client"; import { useEffect, useMemo, useState } from "react"; @@ -48,8 +49,12 @@ function ownerLabel(o: Rec["owner"]) { return o.username || String(o.id ?? "—"); } +// Use public Directus base for sources so images actually load +const API_BASE = (process.env.NEXT_PUBLIC_API_BASE_URL || "").replace(/\/$/, ""); function fileUrl(id?: string) { - return id ? `/api/dx/assets/${id}` : ""; + if (!id) return ""; + if (API_BASE) return `${API_BASE}/assets/${id}`; + return `/api/dx/assets/${id}`; // fallback if you proxy assets } export default function CO2GalvoDetail({ @@ -166,16 +171,16 @@ export default function CO2GalvoDetail({ setting_notes: rec.setting_notes ?? "", photo: photoId, screen: screenId, - mat: matId ? String(matId) : null, - mat_coat: coatId ? String(coatId) : null, - mat_color: colorId ? String(colorId) : null, - mat_opacity: opacityId ? String(opacityId) : null, + mat: matId ? String(matId) : null, + mat_coat: coatId ? String(coatId) : null, + mat_color: colorId ? String(colorId) : null, + mat_opacity: opacityId ? String(opacityId) : null, mat_thickness: rec.mat_thickness ?? null, - source: sourceId != null ? String(sourceId) : null, - lens: lensId != null ? String(lensId) : null, - focus: rec.focus ?? null, - laser_soft: rec.laser_soft ?? null, - repeat_all: rec.repeat_all ?? null, + source: sourceId != null ? String(sourceId) : null, + lens: lensId != null ? String(lensId) : null, + focus: rec.focus ?? null, + laser_soft: rec.laser_soft ?? null, + repeat_all: rec.repeat_all ?? null, fill_settings: rec.fill_settings ?? [], line_settings: rec.line_settings ?? [], raster_settings: rec.raster_settings ?? [], @@ -251,13 +256,23 @@ export default function CO2GalvoDetail({
{photoId ? (
- Result + Result { e.currentTarget.style.display = "none"; }} + />
Result
) : null} {screenId ? (
- Settings screenshot + Settings screenshot { e.currentTarget.style.display = "none"; }} + />
Settings Screenshot
) : null}