Files
jp 0917366cdf Separate JSON API backend (vm_api.py) + React+TanStack frontend scaffold
- vm_api.py: pure FastAPI JSON API on :8098 with CORS
- vm-api.service: systemd unit for API (replaces inline HTML vm_web.py for frontend)
- vm_web.py: kept intact as fallback; Apache now proxies /api/ -> :8098
- frontend/: Vite + React + TanStack Query scaffold
- Apache vhost updated: DocumentRoot -> frontend/dist, /api/ proxy, SPA fallback
- All original HTML pages still functional via :8099 during transition
2026-08-13 17:42:33 +01:00

36 lines
1.4 KiB
JavaScript

"use client";
import { useHydrated } from "./ClientOnly.js";
import { useRouter } from "./useRouter.js";
import { Asset } from "./Asset.js";
import { useTags } from "./headContentUtils.js";
import { DEV_STYLES_ATTR } from "@tanstack/router-core";
import * as React$1 from "react";
import { createElement } from "react";
import { Fragment, jsx } from "react/jsx-runtime";
//#region src/HeadContent.dev.tsx
/**
* Render route-managed head tags (title, meta, links, styles, head scripts).
* Place inside the document head of your app shell.
*
* Development version: filters out dev styles link after hydration and
* includes a fallback cleanup effect for hydration mismatch cases.
*
* @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management
*/
function HeadContent(props) {
const tags = useTags(props.assetCrossOrigin);
const nonce = useRouter().options.ssr?.nonce;
const hydrated = useHydrated();
React$1.useEffect(() => {
if (hydrated) document.querySelectorAll(`link[${DEV_STYLES_ATTR}]`).forEach((el) => el.remove());
}, [hydrated]);
return /* @__PURE__ */ jsx(Fragment, { children: (hydrated ? tags.filter((tag) => tag.tag !== "link" || tag.attrs?.[DEV_STYLES_ATTR] !== true) : tags).map((tag) => /* @__PURE__ */ createElement(Asset, {
...tag,
key: `tsr-meta-${JSON.stringify(tag)}`,
nonce
})) });
}
//#endregion
export { HeadContent };
//# sourceMappingURL=HeadContent.dev.js.map