latest changes

This commit is contained in:
remco committed 2026-07-01 15:06:52 +02:00
1 parent 56cd6fd058
commit 1de72863db
40 files changed
+3837 -568

No files matched your search

-39
View File
@@ -1,39 +0,0 @@
import { siteSettings } from "./site-settings";
/**
* Builds the Nitro client launch URL, faithful to AtomCMS's NitroController +
* nitro.blade.php:
*
* {nitro_path}/index.html?sso={ticket}&toolbar_primary=…&toolbar_hover=…
* &toolbar_border=…&toolbar_text=…
*
* The client files are served by the web root at `nitro_path` (e.g.
* `/Nitro-V3/dist`). Returns "" when no `nitro_path` is configured.
*/
export async function buildNitroClientUrl(ticket: string): Promise<string> {
const [nitroPathRaw, tPrimary, tHover, tBorder, tText, bPrimary, bHover, bBorder, bText] =
await Promise.all([
siteSettings.get("nitro_path", ""),
siteSettings.get("toolbar_primary_color", ""),
siteSettings.get("toolbar_hover_color", ""),
siteSettings.get("toolbar_border_color", ""),
siteSettings.get("toolbar_text_color", ""),
siteSettings.get("button_primary_color", ""),
siteSettings.get("button_hover_color", ""),
siteSettings.get("button_border_color", ""),
siteSettings.get("button_text_color", ""),
]);
const nitroPath = (nitroPathRaw ?? "").trim().replace(/\/+$/, "");
if (!nitroPath) return "";
// Same fallbacks as the blade: toolbar_* color, else button_* color, else the
// atom defaults. URLSearchParams encodes "#" → "%23" so the query is valid.
const params = new URLSearchParams({ sso: ticket });
params.set("toolbar_primary", tPrimary || bPrimary || "#eeb425");
params.set("toolbar_hover", tHover || bHover || "#cf9d15");
params.set("toolbar_border", tBorder || bBorder || "#cf9d15");
params.set("toolbar_text", tText || bText || "#1a1a2e");
return `${nitroPath}/index.html?${params.toString()}`;
}
+2 -2
View File
@@ -4,9 +4,9 @@ import { prisma } from "@/lib/prisma";
// so the app still renders (e.g. local dev without a DATABASE_URL).
const DEFAULTS: Record<string, string> = {
hotel_name: "Atom",
habbo_imaging_url: "https://www.habbo.com/habbo-imaging/avatarimage",
habbo_imaging_url: "https://epicnabbo.nl/imaging/",
logo_url: "",
nitro_path: "",
nitro_client_url: "",
};
/**