Add scoreMessage

This commit is contained in:
2025-07-17 21:07:10 +07:00
parent d40ee7a86e
commit 7de18673f9
9 changed files with 54 additions and 24 deletions

View File

@@ -267,16 +267,36 @@ const BacktestTable: React.FC<BacktestTableProps> = ({list, isFetching, onSortCh
{
Header: 'Score',
accessor: 'score',
Cell: ({cell}: any) => (
<span style={{
color: getScoreColor(cell.row.values.score),
fontWeight: 500,
display: 'inline-block',
width: '60px'
}}>
{cell.row.values.score.toFixed(2)}
</span>
),
Cell: ({cell}: any) => {
const backtest = cell.row.original as LightBacktestResponse;
const scoreMessage = backtest.scoreMessage || 'No scoring details available';
return (
<div className="dropdown dropdown-right bg-base-200">
<div
tabIndex={0}
role="button"
className="cursor-help"
style={{
color: getScoreColor(cell.row.values.score),
fontWeight: 500,
display: 'inline-block',
width: '60px'
}}
>
{cell.row.values.score.toFixed(2)}
</div>
<div
tabIndex={0}
className="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-96 max-h-64 overflow-y-auto"
>
<div className="text-sm whitespace-pre-wrap">
{scoreMessage}
</div>
</div>
</div>
);
},
disableFilters: true,
disableSortBy: false,
sortType: 'basic',

View File

@@ -3432,6 +3432,7 @@ export interface Backtest {
score: number;
requestId?: string;
metadata?: any | null;
scoreMessage?: string;
}
export interface TradingBotConfig {
@@ -3816,6 +3817,7 @@ export interface LightBacktestResponse {
fees?: number;
sharpeRatio?: number | null;
score?: number;
scoreMessage?: string | null;
}
export interface RunBacktestRequest {

View File

@@ -238,6 +238,7 @@ export interface Backtest {
score: number;
requestId?: string;
metadata?: any | null;
scoreMessage?: string;
}
export interface TradingBotConfig {
@@ -622,6 +623,7 @@ export interface LightBacktestResponse {
fees?: number;
sharpeRatio?: number | null;
score?: number;
scoreMessage?: string | null;
}
export interface RunBacktestRequest {