mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
- Refactor BevyScene
to replace script injection with dynamic import
.
- Update `NavItem` to provide fallback route for invalid `path`. - Temporarily stub metric API endpoints with placeholders.
This commit is contained in:

committed by
Geoff Seemueller

parent
0ff8b5c03e
commit
3901337163
@@ -9,13 +9,19 @@ export interface BevySceneProps {
|
|||||||
|
|
||||||
export const BevyScene: React.FC<BevySceneProps> = ({ speed = 1, intensity = 1, glow = false }) => {
|
export const BevyScene: React.FC<BevySceneProps> = ({ speed = 1, intensity = 1, glow = false }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const script = document.createElement('script');
|
(async () => {
|
||||||
script.src = '/yachtpit.js';
|
const module = await import('/public/yachtpit.js', { type: 'module' });
|
||||||
script.type = 'module';
|
console.log('init', module);
|
||||||
document.body.appendChild(script);
|
await module.default();
|
||||||
script.onload = loaded => {
|
})();
|
||||||
console.log('loaded', loaded);
|
// const script = document.createElement('script');
|
||||||
};
|
// script.src = '';
|
||||||
|
// script.type = 'module';
|
||||||
|
// document.body.appendChild(script);
|
||||||
|
// script.onload = loaded => {
|
||||||
|
// loaded.target?.init();
|
||||||
|
// console.log('loaded', loaded);
|
||||||
|
// };
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -5,7 +5,7 @@ function NavItem({ path, children, color, onClick, as, cursor }) {
|
|||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
as={as ?? 'a'}
|
as={as ?? 'a'}
|
||||||
href={path}
|
href={path && path.length > 1 ? path : '/'}
|
||||||
mb={2}
|
mb={2}
|
||||||
cursor={cursor}
|
cursor={cursor}
|
||||||
// ml={5}
|
// ml={5}
|
||||||
|
@@ -52,13 +52,15 @@ export function createRouter() {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
.get('/api/metrics*', async (r, e, c) => {
|
.get('/api/metrics*', async (r, e, c) => {
|
||||||
const { metricsService } = createRequestContext(e, c);
|
return new Response('ok');
|
||||||
return metricsService.handleMetricsRequest(r);
|
// const { metricsService } = createRequestContext(e, c);
|
||||||
|
// return metricsService.handleMetricsRequest(r);
|
||||||
})
|
})
|
||||||
|
|
||||||
.post('/api/metrics*', async (r, e, c) => {
|
.post('/api/metrics*', async (r, e, c) => {
|
||||||
const { metricsService } = createRequestContext(e, c);
|
return new Response('ok');
|
||||||
return metricsService.handleMetricsRequest(r);
|
// const { metricsService } = createRequestContext(e, c);
|
||||||
|
// return metricsService.handleMetricsRequest(r);
|
||||||
})
|
})
|
||||||
|
|
||||||
// renders the app
|
// renders the app
|
||||||
|
Reference in New Issue
Block a user