Fix worker and signal

This commit is contained in:
2025-07-21 23:30:54 +07:00
parent 83ed78a1fa
commit 27c1e9d1ba
13 changed files with 132 additions and 60 deletions

View File

@@ -42,7 +42,7 @@ const getBadgeColor = (signalType: SignalType) => {
// Helper function to format indicator type for display
const formatIndicatorType = (type: IndicatorType) => {
return type.replace(/([A-Z])/g, ' $1').trim();
return type.length > 0 ? type.replace(/([A-Z])/g, ' $1').trim() : 'Unknown';
};
const IndicatorsDisplay: React.FC<IndicatorsDisplayProps> = ({ indicators, className = "" }) => {

View File

@@ -6,6 +6,7 @@ import Toast from '../../components/mollecules/Toast/Toast';
import {useQuery} from '@tanstack/react-query';
import * as signalR from '@microsoft/signalr';
import AuthorizedApiBase from '../../generated/AuthorizedApiBase';
import BacktestTable from '../../components/organism/Backtest/backtestTable';
interface BundleRequestModalProps {
open: boolean;
@@ -125,32 +126,7 @@ const BundleRequestModal: React.FC<BundleRequestModalProps> = ({ open, onClose,
) : queryError ? (
<div className="text-error">{(queryError as any)?.message || 'Failed to fetch backtests'}</div>
) : (
<div className="overflow-x-auto max-h-96">
<table className="table table-zebra w-full text-xs">
<thead>
<tr>
<th>ID</th>
<th>Final PnL</th>
<th>Win Rate</th>
<th>Growth %</th>
<th>Start</th>
<th>End</th>
</tr>
</thead>
<tbody>
{backtests.map((b) => (
<tr key={b.id}>
<td className="font-mono">{b.id}</td>
<td>{b.finalPnl}</td>
<td>{b.winRate}</td>
<td>{b.growthPercentage}</td>
<td>{b.startDate ? new Date(b.startDate).toLocaleString() : '-'}</td>
<td>{b.endDate ? new Date(b.endDate).toLocaleString() : '-'}</td>
</tr>
))}
</tbody>
</table>
</div>
<BacktestTable list={backtests} />
)}
<div className="modal-action">
<button className="btn" onClick={onClose}>Close</button>