Commit Graph

88 Commits

Author SHA1 Message Date
dekun bb53beb22d Hide zero USDT in options balance labels and add swap/transfer all buttons.
Skip 0 balances in header display; fill max funding/trading amount on 全部兑换/全部划转.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 08:55:30 +08:00
dekun 551c86264a Fix OKX spot swap tgtCcy and show options trading USDT in header.
OKX requires quote_ccy/base_ccy for market orders; include trading_usdt in balance display and total funds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 08:42:33 +08:00
dekun 04fd84757c Improve light theme contrast on options positions panel.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 15:09:02 +08:00
dekun 02472f19cb Fix breakeven badge still showing after roll lowers stop loss.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 16:52:29 +08:00
dekun edfe935fb4 Register instance_stats.js static route so period tabs work on all exchanges.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 14:02:24 +08:00
dekun c97cc2823c Fix corrupted embed stats fragment causing 500 and broken period tabs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 13:57:09 +08:00
dekun 40dbafe851 Fix instance stats week/month tabs not responding after embed preload.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 13:50:25 +08:00
dekun 6aaa328a24 Add tabbed period stats with lightweight charts on instance pages.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 13:27:02 +08:00
dekun 944673cac1 Improve hub and instance navigation contrast for light and dark themes.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 12:33:54 +08:00
dekun f99900ac40 Fix intermittent loss of options positions and realtime PnL on refresh.
Use stale-while-revalidate for positions API and UI, throttle sync calls, and avoid overwriting displayed PnL with null on transient failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 18:09:58 +08:00
dekun 23ba725c89 Fix intraday profit amount and hide TP/SL cancel for day trades.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 09:55:09 +08:00
dekun d3a44b23db Split journal order type from entry reason and fix review edit toggle in embed shell.
Adds order_type to journal uploads, removes legacy swing/trend labels from entry reason options, and ensures review-edit buttons sync when the records tab loads dynamically.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 09:27:03 +08:00
dekun 4abe8a6ca9 Fix instance settings prefs JS 404 on static route.
Register instance_settings_prefs.js (and options_panel.js) in install_instance_theme_static; add delegated click handlers for embed lazy tabs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 00:07:30 +08:00
dekun f5bdaee886 Fix instance nav display prefs save in embed shell.
Re-bind save button when settings tab loads lazily; scope form lookup to settings pane.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 23:58:06 +08:00
dekun b733e551a0 Normalize fullwidth punctuation to ASCII across codebase.
Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 23:42:26 +08:00
dekun 823aeda42a Add hub AI config tab with sync to instances and deploy secret bootstrap.
Wire bootstrap_deploy_secrets into setup_env.sh (one-time HUB_BRIDGE_TOKEN, FLASK_SECRET_KEY, HUB_SESSION_SECRET). Remove AI section from instance env UI; hub saves OPENAI settings to all four .env files. SSO unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 22:50:58 +08:00
dekun 2e0bde9cc2 Fix settings 500: pop display before building instance settings view.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:50:31 +08:00
dekun 1ee9eb02c3 Add settings page tabs and show env API keys with last four digits.
System settings now use the same CSS tab layout as env config; sensitive env fields display masked values from .env while keeping save-on-empty behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:31:14 +08:00
dekun 12e44ab26d Fix env config tabs with CSS radio labels, no JS required
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:19:23 +08:00
dekun 4b3373a68d Fix env config tab clicks via document event delegation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:14:42 +08:00
dekun 576f6fbcfc Redesign env config UI: tabs, 2-col form, remove per-field badges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:10:54 +08:00
dekun 0d2ce9c126 Add curated env config UI with Chinese labels and deploy secret bootstrap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:03:00 +08:00
dekun 0b91d26f71 Fix Jinja conflict: rename display meta items to entries
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:38:52 +08:00
dekun 68e03ccd97 Fix settings tab 500 and env config grouping in UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:33:31 +08:00
dekun aa966114b1 Fix settings and env config stuck on loading via SSR form render
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:24:15 +08:00
dekun 6975da8575 Fix settings loading and use 2-column card layout.
Merge Flask GET/POST routes, refresh prefs on tab revisit after preload, and reorganize system settings into separate cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:12:22 +08:00
dekun ef4b2f17ca Add instance nav prefs, env config UI, and PM2 restart.
P1-P4: configurable nav/section visibility in system settings, full .env editor with restart badges, password change, runtime hot overrides, and single-instance pm2 restart. Works in hub embed iframe.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:07:06 +08:00
dekun d84a265b67 Split risk policy into its own navigation tab.
Move read-only risk control docs to /risk_policy before settings; keep transfers and exports on the settings page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 19:42:29 +08:00
dekun fd6391b734 Remove manual refresh funds button from header.
Account snapshot already refreshes automatically on load, interval, and tab switch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 19:18:44 +08:00
dekun 0d27e13275 Fix header funds flicker and unify settings page top bar.
Preserve SSR fund values when account_snapshot returns null, retry on failure, and show the same instance header panel on system settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 19:08:08 +08:00
dekun 279648de56 Add hub TP profit field, 2-decimal options PnL, and exchange mark price display.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 17:22:26 +08:00
dekun e3e53ff7f5 Fix roll position display: live contracts, TP profit, and 2-decimal qty precision.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 17:06:33 +08:00
dekun f5f302b97e Add month/quarter/half-year/all list window presets with this month as default.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 11:22:29 +08:00
dekun f68197b775 Include options unrealized PnL in OKX instance header realtime PnL total.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 11:05:52 +08:00
dekun 11a50c02cd fix(theme): improve light mode contrast across instance and options pages
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 12:23:22 +08:00
dekun afb191f90a fix(theme): show toggle on standalone embed shell, not only hub iframe
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 12:18:18 +08:00
dekun b29c54f126 fix(settings): restore theme toggle on OKX settings page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 12:14:46 +08:00
dekun 68d8a97db5 fix(settings): equal columns, form-style option transfers, compact export
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 12:09:12 +08:00
dekun 27a00f026a fix(settings): OKX side panel shell, compact option transfers without selects
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:43:56 +08:00
dekun 6c26d4739e fix(settings): horizontal export links and strict OKX side column height
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:35:36 +08:00
dekun 5680ab515e fix: stretch settings side cards to match left column height
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:29:14 +08:00
dekun 2ad9e049f3 fix(okx): cache options balances and stop SSE from hammering exchange API
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:15:06 +08:00
dekun 799a4d6b8b fix: enable threaded Flask for SSE and make embed tab switch instant
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:09:34 +08:00
dekun 3db84d07e3 feat: instance embed SSE live push and lighter tab revisit
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:01:10 +08:00
dekun 444088baf3 fix: reduce embed tab flash with persistent pane show/hide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:53:42 +08:00
dekun 86188e6611 fix: import urlencode from urllib.parse in embed redirect
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:48:38 +08:00
dekun 30e40dc34c perf: embed shell soft nav, tab cache, and lighter options page boot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:42:01 +08:00
dekun 8913138dc3 style: tighten options page typography and spacing
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:35:00 +08:00
dekun 2a3f36d34f feat: split options settings into compact swap and transfer cards with aligned columns
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:18:41 +08:00
dekun 75aa4b1391 feat: single-row funds strip on header and system settings page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 10:09:51 +08:00