diff --git a/pkg/dash/app_html.py b/pkg/dash/app_html.py index d7984da..79a06f6 100644 --- a/pkg/dash/app_html.py +++ b/pkg/dash/app_html.py @@ -20,9 +20,7 @@ def layout_config(app): html.Div( id='clock-tooltip', children=[ - html.Div(id='pst-clock'), - html.Div(id='cst-clock'), - html.Div(id='est-clock') + html.Div(id='pst-clock') ], style={ 'position': 'absolute', diff --git a/pkg/dash/func/clock.py b/pkg/dash/func/clock.py index 17b72ef..ed879ad 100644 --- a/pkg/dash/func/clock.py +++ b/pkg/dash/func/clock.py @@ -3,12 +3,10 @@ from pkg.dash.app_init import app from dash.dependencies import Input, Output from pkg.config import pacific,central,eastern from datetime import datetime +from dash import html -# Callback for updating clocks (unchanged) @app.callback( - [Output('pst-clock', 'children'), - Output('cst-clock', 'children'), - Output('est-clock', 'children')], + [Output('pst-clock', 'children')], [Input('clock-interval', 'n_intervals')] ) def update_clocks(n): @@ -16,4 +14,17 @@ def update_clocks(n): pst_time = now_utc.astimezone(pacific).strftime('%Y-%m-%d %H:%M:%S PST') cst_time = now_utc.astimezone(central).strftime('%Y-%m-%d %H:%M:%S CST') est_time = now_utc.astimezone(eastern).strftime('%Y-%m-%d %H:%M:%S EST') - return f"𝕏: {pst_time}", f"🚀: {cst_time}", f"🏛️/🌴: {est_time}" + + table = html.Table([ + html.Tr([html.Td('𝕏', style={'textAlign': 'center'}), html.Td(pst_time)]), + html.Tr([html.Td('🚀', style={'textAlign': 'center'}), html.Td(cst_time)]), + html.Tr([html.Td('🏛️🌴', style={'textAlign': 'center'}), html.Td(est_time)]) + ], style={ + 'width': '100%', + 'textAlign': 'left', + 'borderCollapse': 'collapse' + }) + + return [table] + + diff --git a/plan.md b/plan.md index 7b8716c..cdf3dfd 100644 --- a/plan.md +++ b/plan.md @@ -1,8 +1,5 @@ #### 2025.3.4 -1. 完善main.py的 ▶️🔄✅ - * 使用api的方式,前端请求,后端api返回结果 -2. 实时时间显示对齐 -3. 添加一天内发帖热图 +1. 添加一天内发帖热图 #### 后续 1. 考虑通过 tweets 数预测市场曲线的模型(人工智能)