apply query.basePath

This commit is contained in:
c9s 2022-05-19 02:21:21 +08:00
parent 4961214c1b
commit d10f69c680
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 8 additions and 5 deletions

View File

@ -166,8 +166,8 @@ const ReportDetails = (props: ReportDetailsProps) => {
<Container my="md" mx="xs">
<Title order={2}>RUN {props.runID}</Title>
<div>
{reportSummary.sessions.map((session) => <Badge>Exchange {session}</Badge>)}
{reportSummary.symbols.map((symbol) => <Badge>{symbol}</Badge>)}
{reportSummary.sessions.map((session) => <Badge key={session}>Exchange {session}</Badge>)}
{reportSummary.symbols.map((symbol) => <Badge key={symbol}>{symbol}</Badge>)}
<Badge>{reportSummary.startTime.toString()} ~ {reportSummary.endTime.toString()}</Badge>
<Badge>{

View File

@ -1,15 +1,18 @@
import type {NextPage} from 'next'
import Head from 'next/head'
import styles from '../styles/Home.module.css'
import { useRouter } from "next/router";
import {AppShell, Header, Navbar, Text} from '@mantine/core';
import ReportDetails from '../components/ReportDetails';
import ReportNavigator from '../components/ReportNavigator';
import {useState} from "react";
import {useEffect, useState} from "react";
const Home: NextPage = () => {
const [currentReport, setCurrentReport] = useState<any>();
const { query } = useRouter();
const basePath = query.basePath ? query.basePath as string : '/output';
return (
<div>
<Head>
@ -37,7 +40,7 @@ const Home: NextPage = () => {
})}
>
{
currentReport ? <ReportDetails basePath={'/output'} runID={currentReport.id}/> : null
currentReport ? <ReportDetails basePath={basePath} runID={currentReport.id}/> : null
}
</AppShell>
</main>