Skip to content

Commit b91cfcc

Browse files
Jinyu XuJinyu Xu
authored andcommitted
chore(release): update social links and v2.2.3
- Update X/Discord links in docs and frontend dist - Dashboard: report all-time total trades - Notifications: add unread-count endpoint for badge Made-with: Cursor
1 parent cbe5d8d commit b91cfcc

132 files changed

Lines changed: 1213 additions & 745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Frontend Source (CLOSED SOURCE - NOT tracked)
88
# ========================
99
/quantdinger_vue/
10+
/QuantDinger-Vue-src/
1011

1112
# ========================
1213
# Frontend dist - DO track (pre-built)

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
<p>
4040
<a href="https://t.me/quantdinger"><img src="https://img.shields.io/badge/Telegram-Group-26A5E4?style=for-the-badge&logo=telegram" alt="Telegram"></a>
41-
<a href="https://discord.gg/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-Server-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
42-
<a href="https://x.com/HenryCryption"><img src="https://img.shields.io/badge/X-Follow-000000?style=for-the-badge&logo=x" alt="X"></a>
41+
<a href="https://discord.com/invite/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-Server-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
42+
<a href="https://x.com/quantdinger_en"><img src="https://img.shields.io/badge/X-Follow-000000?style=for-the-badge&logo=x" alt="X"></a>
4343
</p>
4444

4545
<sub>🇺🇸 <a href="README.md">English</a> · 🇨🇳 <a href="docs/README_CN.md">简体中文</a> · 🇹🇼 繁體中文 · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇩🇪 Deutsch · 🇫🇷 Français · 🇹🇭 ไทย · 🇻🇳 Tiếng Việt · 🇸🇦 العربية</sub>
@@ -536,7 +536,7 @@ For **commercial use**, purchase a license to get:
536536

537537
<p>
538538
<a href="https://t.me/quantdinger"><img src="https://img.shields.io/badge/Telegram-Group-26A5E4?style=for-the-badge&logo=telegram" alt="Telegram"></a>
539-
<a href="https://discord.gg/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-Server-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
539+
<a href="https://discord.com/invite/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-Server-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
540540
<a href="https://youtube.com/@quantdinger"><img src="https://img.shields.io/badge/YouTube-Channel-FF0000?style=for-the-badge&logo=youtube" alt="YouTube"></a>
541541
</p>
542542

‎backend_api_python/app/routes/dashboard.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@ def _truthy(v: Any) -> bool:
379379
)
380380

381381
# Recent trades (best-effort, filtered by user_id)
382+
# Also compute all-time trade count for dashboard top cards.
383+
with get_db_connection() as db:
384+
cur = db.cursor()
385+
cur.execute("SELECT COUNT(1) AS cnt FROM qd_strategy_trades WHERE user_id = ?", (user_id,))
386+
total_trades_all = int((cur.fetchone() or {}).get("cnt") or 0)
387+
cur.close()
388+
382389
with get_db_connection() as db:
383390
cur = db.cursor()
384391
cur.execute(
@@ -413,6 +420,8 @@ def _truthy(v: Any) -> bool:
413420

414421
# Compute performance statistics with initial capital for proper drawdown calculation
415422
perf_stats = _compute_performance_stats(recent_trades, initial_capital=total_initial_capital)
423+
# For dashboard top card: show all-time total trade count (not limited by LIMIT 500).
424+
perf_stats["total_trades"] = int(total_trades_all)
416425

417426
# Compute per-strategy statistics
418427
strategy_stats = _compute_strategy_stats(recent_trades, strategies)

‎backend_api_python/app/routes/strategy.py‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,53 @@ def get_strategy_notifications():
895895
return jsonify({'code': 0, 'msg': str(e), 'data': {'items': []}}), 500
896896

897897

898+
@strategy_bp.route('/strategies/notifications/unread-count', methods=['GET'])
899+
@login_required
900+
def get_unread_notification_count():
901+
"""
902+
Get unread notification count for the current user.
903+
Used by frontend header badge (cap at 99+ on UI).
904+
"""
905+
try:
906+
user_id = g.user_id
907+
908+
with get_db_connection() as db:
909+
cur = db.cursor()
910+
cur.execute("SELECT id FROM qd_strategies_trading WHERE user_id = ?", (user_id,))
911+
rows = cur.fetchall() or []
912+
user_strategy_ids = [r.get('id') for r in rows if r.get('id')]
913+
cur.close()
914+
915+
where = ["is_read = 0"]
916+
args = []
917+
918+
if user_strategy_ids:
919+
placeholders = ",".join(["?"] * len(user_strategy_ids))
920+
where.append(f"(strategy_id IN ({placeholders}) OR (strategy_id IS NULL AND user_id = ?))")
921+
args.extend(user_strategy_ids)
922+
args.append(user_id)
923+
else:
924+
where.append("strategy_id IS NULL AND user_id = ?")
925+
args.append(user_id)
926+
927+
where_sql = "WHERE " + " AND ".join(where)
928+
929+
with get_db_connection() as db:
930+
cur = db.cursor()
931+
cur.execute(
932+
f"SELECT COUNT(1) AS cnt FROM qd_strategy_notifications {where_sql}",
933+
tuple(args),
934+
)
935+
cnt = int((cur.fetchone() or {}).get("cnt") or 0)
936+
cur.close()
937+
938+
return jsonify({'code': 1, 'msg': 'success', 'data': {'unread': cnt}})
939+
except Exception as e:
940+
logger.error(f"get_unread_notification_count failed: {str(e)}")
941+
logger.error(traceback.format_exc())
942+
return jsonify({'code': 0, 'msg': str(e), 'data': {'unread': 0}}), 500
943+
944+
898945
@strategy_bp.route('/strategies/notifications/read', methods=['POST'])
899946
@login_required
900947
def mark_notification_read():

‎docs/README_CN.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
<p>
3838
<a href="https://t.me/quantdinger"><img src="https://img.shields.io/badge/Telegram-群组-26A5E4?style=for-the-badge&logo=telegram" alt="Telegram"></a>
39-
<a href="https://discord.gg/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-服务器-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
40-
<a href="https://x.com/HenryCryption"><img src="https://img.shields.io/badge/X-关注-000000?style=for-the-badge&logo=x" alt="X"></a>
39+
<a href="https://discord.com/invite/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-服务器-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
40+
<a href="https://x.com/quantdinger_en"><img src="https://img.shields.io/badge/X-关注-000000?style=for-the-badge&logo=x" alt="X"></a>
4141
</p>
4242

4343
<sub>🇺🇸 English · 🇨🇳 简体中文 · 🇹🇼 繁體中文 · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇩🇪 Deutsch · 🇫🇷 Français · 🇹🇭 ไทย · 🇻🇳 Tiếng Việt · 🇸🇦 العربية</sub>
@@ -506,7 +506,7 @@ QuantDinger/
506506

507507
<p>
508508
<a href="https://t.me/quantdinger"><img src="https://img.shields.io/badge/Telegram-群组-26A5E4?style=for-the-badge&logo=telegram" alt="Telegram"></a>
509-
<a href="https://discord.gg/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-服务器-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
509+
<a href="https://discord.com/invite/tyx5B6TChr"><img src="https://img.shields.io/badge/Discord-服务器-5865F2?style=for-the-badge&logo=discord" alt="Discord"></a>
510510
<a href="https://youtube.com/@quantdinger"><img src="https://img.shields.io/badge/YouTube-频道-FF0000?style=for-the-badge&logo=youtube" alt="YouTube"></a>
511511
</p>
512512

0 commit comments

Comments
 (0)