From f50f98e29255a5c38e9dcc1c8548613953411b36 Mon Sep 17 00:00:00 2001 From: ericwyuan Date: Thu, 20 Aug 2026 23:50:31 +0800 Subject: [PATCH] =?UTF-8?q?ui:=20=E4=BA=8B=E4=BB=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9D=A1=E7=9B=AE=E5=B8=A6=E5=B9=B4=E6=9C=88=E6=97=A5=20?= =?UTF-8?q?=E2=80=94=20=E8=B7=A8=E5=A4=A9=E4=BA=8B=E4=BB=B6=E5=8F=AF?= =?UTF-8?q?=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 跨多天的事件列表仅显示 HH:MM 无法区分日期。按钮标签加 MM-DD 前缀,摘要行加浅蓝 YYYY-MM-DD 前缀,摘要截断 26→30 字适配。 --- fam-ui/src/app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fam-ui/src/app.py b/fam-ui/src/app.py index 2e9370c..2e72e44 100644 --- a/fam-ui/src/app.py +++ b/fam-ui/src/app.py @@ -521,11 +521,12 @@ if page == "🕒 事件时间轴": unsafe_allow_html=True) for ev in events: ts = parse_ts(ev['event_start_time']) - time_label = ts.strftime('%H:%M') if ts else '--:--' + time_label = ts.strftime('%m-%d %H:%M') if ts else '--:--' + date_label = ts.strftime('%Y-%m-%d') if ts else '' summary = (ev.get('global_summary') or '').strip() if not summary: summary = '暂无摘要' - summary_short = summary if len(summary) <= 26 else summary[:26] + '…' + summary_short = summary if len(summary) <= 30 else summary[:30] + '…' is_selected = ev['event_id'] == selected_id if st.button( f"{'▶ ' if is_selected else ''}{time_label} · {ev.get('camera_name') or '未知'} · {ev['detail_count']}帧", @@ -535,9 +536,11 @@ if page == "🕒 事件时间轴": ): st.session_state.selected_event_id = ev['event_id'] st.rerun() + date_html = (f'{date_label} · ' + if date_label else '') st.markdown( f'
{esc(summary_short)}
', + f'line-height:1.5;">{date_html}{esc(summary_short)}', unsafe_allow_html=True) # 分页