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