feat: 添加 Redis 消息展示功能到监控面板

- 新增 /api/messages API 接口,支持从 Redis Stream 读取消息
- 支持按策略筛选消息和分页展示
- 前端新增消息列表卡片,展示时间、策略、股票代码、动作、价格和状态
- 自动判断消息处理状态(已处理/待处理)
- 消息列表每30秒自动刷新,支持手动刷新
This commit is contained in:
2026-03-01 22:06:42 +08:00
parent e88ba5bcf9
commit 7bb0a0537b
14 changed files with 1814 additions and 806 deletions

View File

@@ -34,17 +34,17 @@
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Index: 9413748 entries, 0 to 25875\n",
"Index: 9439640 entries, 0 to 25891\n",
"Data columns (total 2 columns):\n",
" # Column Dtype \n",
"--- ------ ----- \n",
" 0 ts_code object\n",
" 1 trade_date object\n",
"dtypes: object(2)\n",
"memory usage: 215.5+ MB\n",
"memory usage: 216.1+ MB\n",
"None\n",
"20260206\n",
"start_date: 20260209\n"
"20260213\n",
"start_date: 20260224\n"
]
}
],
@@ -94,12 +94,7 @@
"任务 20260227 完成\n",
"任务 20260226 完成\n",
"任务 20260225 完成\n",
"任务 20260224 完成\n",
"任务 20260213 完成\n",
"任务 20260212 完成\n",
"任务 20260211 完成\n",
"任务 20260210 完成\n",
"任务 20260209 完成\n"
"任务 20260224 完成\n"
]
}
],
@@ -189,71 +184,71 @@
"output_type": "stream",
"text": [
" ts_code trade_date buy_sm_vol buy_sm_amount sell_sm_vol \\\n",
"0 300587.SZ 20260213 154110 9661.44 160598 \n",
"1 601000.SH 20260213 150959 6301.54 197344 \n",
"2 002338.SZ 20260213 9215 5012.78 8260 \n",
"3 688373.SH 20260213 29166 1845.78 30329 \n",
"4 002226.SZ 20260213 101435 6137.98 79302 \n",
"0 002968.SZ 20260227 21302 2803.57 22552 \n",
"1 600822.SH 20260227 20371 2267.76 18994 \n",
"2 688003.SH 20260227 10527 8037.01 11183 \n",
"3 300894.SZ 20260227 15100 1751.27 16491 \n",
"4 603026.SH 20260227 35310 23574.59 36976 \n",
"... ... ... ... ... ... \n",
"25887 603713.SH 20260209 9898 6481.74 10208 \n",
"25888 300004.SZ 20260209 41923 5934.14 50255 \n",
"25889 300975.SZ 20260209 198244 30367.70 159191 \n",
"25890 603381.SH 20260209 85934 22581.16 95505 \n",
"25891 002836.SZ 20260209 27160 4238.25 22047 \n",
"20704 002587.SZ 20260224 114009 8175.31 115996 \n",
"20705 002474.SZ 20260224 132136 11662.67 104912 \n",
"20706 002742.SZ 20260224 9048 381.92 6158 \n",
"20707 601298.SH 20260224 95226 8736.97 102361 \n",
"20708 301413.SZ 20260224 11648 17813.73 7614 \n",
"\n",
" sell_sm_amount buy_md_vol buy_md_amount sell_md_vol sell_md_amount \\\n",
"0 10061.76 183752 11498.51 186971 11701.15 \n",
"1 8233.85 84549 3527.41 71932 3003.18 \n",
"2 4495.09 9488 5163.47 9035 4920.33 \n",
"3 1918.49 10043 635.49 10005 633.64 \n",
"4 4796.49 104000 6296.98 78239 4741.21 \n",
"0 2971.99 12991 1715.40 11827 1560.91 \n",
"1 2114.45 11869 1321.48 13242 1474.72 \n",
"2 8535.14 6168 4707.52 5857 4472.05 \n",
"3 1914.17 12204 1416.49 10014 1161.98 \n",
"4 24680.03 25979 17356.95 23472 15689.34 \n",
"... ... ... ... ... ... \n",
"25887 6683.01 6735 4413.49 7402 4854.70 \n",
"25888 7133.88 53004 7510.03 58384 8274.31 \n",
"25889 24423.94 164520 25222.01 193044 29612.42 \n",
"25890 25109.67 65977 17316.88 71008 18669.88 \n",
"25891 3438.16 21123 3293.94 20955 3271.07 \n",
"20704 8318.63 70581 5059.80 77960 5594.40 \n",
"20705 9262.36 65247 5760.34 70730 6242.71 \n",
"20706 259.97 12268 517.35 10575 446.72 \n",
"20707 9387.51 17890 1640.43 21755 1995.51 \n",
"20708 11690.25 18481 28263.21 16404 25116.12 \n",
"\n",
" buy_lg_vol buy_lg_amount sell_lg_vol sell_lg_amount buy_elg_vol \\\n",
"0 139274 8711.00 168037 10519.91 60907 \n",
"1 57471 2398.28 37552 1567.23 21177 \n",
"2 5873 3195.64 5312 2890.59 514 \n",
"3 8238 521.88 7113 451.02 0 \n",
"4 50394 3048.72 69021 4177.39 9335 \n",
"0 4640 616.17 5428 716.74 873 \n",
"1 7412 824.96 7836 871.98 420 \n",
"2 5007 3817.18 4258 3252.13 792 \n",
"3 5426 629.63 6225 721.24 0 \n",
"4 14372 9614.17 12027 8050.76 2859 \n",
"... ... ... ... ... ... \n",
"25887 3515 2307.87 4056 2660.17 2867 \n",
"25888 49767 7060.10 39566 5596.12 8820 \n",
"25889 116306 17856.14 144536 22152.02 51550 \n",
"25890 46270 12156.66 38176 10028.63 11944 \n",
"25891 9676 1508.43 11383 1772.18 1000 \n",
"20704 59178 4247.14 57492 4122.70 13717 \n",
"20705 28382 2504.08 47970 4231.98 8727 \n",
"20706 8183 345.88 10348 436.35 2869 \n",
"20707 15594 1429.59 14207 1303.96 12463 \n",
"20708 11245 17223.41 14418 22047.20 2604 \n",
"\n",
" buy_elg_amount sell_elg_vol sell_elg_amount net_mf_vol \\\n",
"0 3816.45 22437 1404.58 142435 \n",
"1 882.70 7328 305.66 -48700 \n",
"2 280.52 2483 1346.40 -483 \n",
"3 0.00 0 0.00 982 \n",
"4 565.27 38602 2333.86 -103058 \n",
"0 114.50 0 0.00 8754 \n",
"1 46.96 0 0.00 -2636 \n",
"2 604.59 1196 906.98 -2186 \n",
"3 0.00 0 0.00 -2514 \n",
"4 1908.59 6045 4034.17 -2211 \n",
"... ... ... ... ... \n",
"25887 1885.53 1349 890.75 1237 \n",
"25888 1251.47 5309 751.42 8180 \n",
"25889 7924.73 33850 5182.21 -41375 \n",
"25890 3157.32 5436 1403.84 -11696 \n",
"25891 155.40 4574 714.61 1257 \n",
"20704 987.82 6038 434.35 32850 \n",
"20705 770.48 10880 960.53 -24208 \n",
"20706 120.50 5287 222.60 -5084 \n",
"20707 1140.48 2850 260.49 4058 \n",
"20708 3986.99 5543 8433.77 -7520 \n",
"\n",
" net_mf_amount \n",
"0 8918.59 \n",
"1 -2025.73 \n",
"2 -250.58 \n",
"3 64.60 \n",
"4 -6231.26 \n",
"0 1160.00 \n",
"1 -291.18 \n",
"2 -1656.29 \n",
"3 -289.80 \n",
"4 -1416.49 \n",
"... ... \n",
"25887 814.61 \n",
"25888 1173.63 \n",
"25889 -6267.77 \n",
"25890 -3055.51 \n",
"25891 191.86 \n",
"20704 2367.64 \n",
"20705 -2127.88 \n",
"20706 -213.09 \n",
"20707 379.12 \n",
"20708 -11475.67 \n",
"\n",
"[25892 rows x 20 columns]\n"
"[20709 rows x 20 columns]\n"
]
}
],
@@ -278,7 +273,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
"version": "3.12.11"
}
},
"nbformat": 4,