Skip to content

Commit 9b812c6

Browse files
committed
visualizer: fix relative path issues
1 parent a0879e8 commit 9b812c6

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

ui/public/scenarios.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
"duration": 300,
77
"trace": "traces/1xsummary.jsonl.gz",
88
"aggregated": true
9+
},
10+
{
11+
"name": "10x",
12+
"topology": "topologies/thousand.yaml",
13+
"duration": 300,
14+
"trace": "traces/10xsummary.jsonl.gz",
15+
"aggregated": true
16+
},
17+
{
18+
"name": "100x",
19+
"topology": "topologies/thousand.yaml",
20+
"duration": 300,
21+
"trace": "traces/100xsummary.jsonl.gz",
22+
"aggregated": true
923
}
1024
]
1125
}

ui/src/components/Sim/modules/Scenario.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export const Scenario: FC = () => {
1010

1111
useEffect(() => {
1212
(async () => {
13-
const response = await fetch("visualizer/scenarios.json");
13+
const response = await fetch("scenarios.json");
1414
const body: { scenarios: IScenario[] } = await response.json();
1515
const scenarios = body.scenarios.map(scenario => ({
1616
...scenario,
17-
topology: new URL(`visualizer/${scenario.topology}`, window.location.toString()).toString(),
18-
trace: new URL(`visualizer/${scenario.trace}`, window.location.toString()).toString(),
17+
topology: new URL(scenario.topology, window.location.toString()).toString(),
18+
trace: new URL(scenario.trace, window.location.toString()).toString(),
1919
}));
2020
dispatch({ type: "SET_SCENARIOS", payload: scenarios });
2121
})();

ui/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
66

77
// https://vite.dev/config/
88
export default defineConfig({
9-
base: '/visualizer',
9+
base: '/',
1010
plugins: [react(), tailwindcss(), nodePolyfills()],
1111
server: {
1212
port: 3000,

0 commit comments

Comments
 (0)