This commit is contained in:
Jun Su 2022-06-16 22:30:05 +08:00
parent 575d0d24a2
commit 12164b694d
6 changed files with 47 additions and 37 deletions

View File

@ -156,7 +156,6 @@ export interface GridStats {
}
export async function queryStrategiesMetrics(): Promise<GridStrategy[]> {
const temp = {
id: 'uuid',
instanceID: 'testInstanceID',
@ -177,15 +176,15 @@ export async function queryStrategiesMetrics(): Promise<GridStrategy[]> {
},
status: 'RUNNING',
startTime: 1654938187102,
}
};
const testArr = [];
for (let i = 0; i < 11; i++) {
const cloned = {...temp}
cloned.id = "uuid" + i;
const cloned = { ...temp };
cloned.id = 'uuid' + i;
testArr.push(cloned);
}
return testArr
return testArr;
}

View File

@ -42,12 +42,10 @@ export default function Detail({ data }:{ data: GridStrategy}) {
<div>{data[strategy].symbol}</div>
<RunningTime seconds={seconds} />
<Description>
0 arbitrages in 24 hours / Total <span>{stats.totalArbs}</span> arbitrages
0 arbitrages in 24 hours / Total <span>{stats.totalArbs}</span>{' '}
arbitrages
</Description>
<Summary
stats={stats}
totalProfitsPercentage={totalProfitsPercentage}
/>
<Summary stats={stats} totalProfitsPercentage={totalProfitsPercentage} />
<Stats
stats={stats}
gridProfitsPercentage={gridProfitsPercentage}

View File

@ -1,5 +1,5 @@
import { styled } from '@mui/styles';
import { Description } from './Detail'
import { Description } from './Detail';
const RunningTimeSection = styled('div')(() => ({
display: 'flex',

View File

@ -7,7 +7,15 @@ const StatsSection = styled('div')(() => ({
gap: '10px',
}));
export default function Stats({stats, gridProfitsPercentage, gridAprPercentage}:{stats: GridStats, gridProfitsPercentage: number, gridAprPercentage: number}){
export default function Stats({
stats,
gridProfitsPercentage,
gridAprPercentage,
}: {
stats: GridStats;
gridProfitsPercentage: number;
gridAprPercentage: number;
}) {
return (
<StatsSection>
<div>

View File

@ -25,7 +25,13 @@ export const Percentage = styled('div')(() => ({
color: 'rgb(123, 169, 90)',
}));
export default function Summary({stats, totalProfitsPercentage}:{stats: GridStats,totalProfitsPercentage:number}) {
export default function Summary({
stats,
totalProfitsPercentage,
}: {
stats: GridStats;
totalProfitsPercentage: number;
}) {
return (
<SummarySection>
<SummaryBlock>
@ -39,5 +45,5 @@ export default function Summary({stats, totalProfitsPercentage}:{stats: GridStat
<Percentage>{totalProfitsPercentage}%</Percentage>
</SummaryBlock>
</SummarySection>
)
);
}

View File

@ -38,7 +38,6 @@ export default function Strategies() {
return <Detail key={element.id} data={element} />;
})}
</StrategiesContainer>
</DashboardLayout>
);
}