- 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
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
"use client";
|
|
const require_useRouter = require("./useRouter.cjs");
|
|
const require_useMatch = require("./useMatch.cjs");
|
|
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
|
|
let _tanstack_react_store = require("@tanstack/react-store");
|
|
//#region src/useLocation.tsx
|
|
/**
|
|
* Read the current location from the router state with optional selection.
|
|
* Useful for subscribing to just the pieces of location you care about.
|
|
*
|
|
* Options:
|
|
* - `select`: Project the `location` object to a derived value
|
|
* - `structuralSharing`: Enable structural sharing for stable references
|
|
*
|
|
* @returns The current location (or selected value).
|
|
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook
|
|
*/
|
|
function useLocation(opts) {
|
|
const router = require_useRouter.useRouter();
|
|
if (_tanstack_router_core_isServer.isServer ?? router.isServer) {
|
|
const location = router.stores.location.get();
|
|
return opts?.select ? opts.select(location) : location;
|
|
}
|
|
return (0, _tanstack_react_store.useStore)(router.stores.location, require_useMatch.useStructuralSharing(opts, router));
|
|
}
|
|
//#endregion
|
|
exports.useLocation = useLocation;
|
|
|
|
//# sourceMappingURL=useLocation.cjs.map
|