Fix running status color; add ETH qty settings with Chinese labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-24 17:24:27 +08:00
parent b6d9877538
commit 5125c6702b
7 changed files with 102 additions and 47 deletions
+35 -5
View File
@@ -24,6 +24,8 @@ export default function SettingsPage() {
const [exitPts, setExitPts] = useState(30);
const [rest, setRest] = useState(300);
const [maxRounds, setMaxRounds] = useState(3);
const [perpQty, setPerpQty] = useState(1);
const [optQty, setOptQty] = useState(2);
const [stratOk, setStratOk] = useState("");
useEffect(() => {
@@ -33,6 +35,8 @@ export default function SettingsPage() {
setExitPts(s.exit_move_points);
setRest(s.rest_seconds);
setMaxRounds(s.max_rounds);
setPerpQty(s.perp_qty_eth ?? 1);
setOptQty(s.option_qty_eth ?? 2);
})
.catch(() => undefined);
}, []);
@@ -80,6 +84,8 @@ export default function SettingsPage() {
exit_move_points: exitPts,
rest_seconds: rest,
max_rounds: maxRounds,
perp_qty_eth: perpQty,
option_qty_eth: optQty,
}),
});
setStratOk("策略参数已保存");
@@ -111,13 +117,37 @@ export default function SettingsPage() {
{tab === "strategy" ? (
<div className="card">
<p style={{ color: "var(--muted)", marginTop: 0 }}>
N =1×
N =1×
</p>
{stratOk ? <div style={{ color: "var(--up)", marginBottom: 12 }}>{stratOk}</div> : null}
{err && tab === "strategy" ? <div className="err">{err}</div> : null}
<form onSubmit={onSaveStrategy}>
<div className="field">
<label htmlFor="exit">EXIT_MOVE_POINTS</label>
<label htmlFor="perp"> ETH </label>
<input
id="perp"
className="mono"
type="number"
step="0.01"
min="0.01"
value={perpQty}
onChange={(e) => setPerpQty(Number(e.target.value))}
/>
</div>
<div className="field">
<label htmlFor="opt"> ETH </label>
<input
id="opt"
className="mono"
type="number"
step="0.01"
min="0.01"
value={optQty}
onChange={(e) => setOptQty(Number(e.target.value))}
/>
</div>
<div className="field">
<label htmlFor="exit"></label>
<input
id="exit"
className="mono"
@@ -128,7 +158,7 @@ export default function SettingsPage() {
/>
</div>
<div className="field">
<label htmlFor="rest">REST_SECONDS</label>
<label htmlFor="rest"></label>
<input
id="rest"
className="mono"
@@ -139,7 +169,7 @@ export default function SettingsPage() {
/>
</div>
<div className="field">
<label htmlFor="rounds">MAX_ROUNDS</label>
<label htmlFor="rounds"></label>
<input
id="rounds"
className="mono"
@@ -150,7 +180,7 @@ export default function SettingsPage() {
/>
</div>
<div className="field">
<label htmlFor="fee">FEE_RATE</label>
<label htmlFor="fee"></label>
<input
id="fee"
className="mono"