diff --git a/client/components/panel.tsx b/client/components/panel.tsx index 932d9680..1ea70016 100644 --- a/client/components/panel.tsx +++ b/client/components/panel.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef } from "preact/hooks"; +import { useEffect, useMemo, useRef } from "preact/hooks"; import type { Client } from "../client.ts"; import type { PanelConfig } from "../types/ui.ts"; import { panelHtml } from "./panel_html.ts"; @@ -12,6 +12,10 @@ export function Panel({ }) { const iFrameRef = useRef(null); + const html = useMemo(() => { + return panelHtml.replace("{{.HostPrefix}}", document.baseURI); + }, []); + function updateContent() { if (!iFrameRef.current?.contentWindow) { return; @@ -87,7 +91,7 @@ export function Panel({ return (