This commit is contained in:
sam 2025-10-06 12:02:40 +08:00
parent 478a9a64af
commit bf7902e755
2 changed files with 21 additions and 5 deletions

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import json import json
import uuid import uuid
from dataclasses import asdict from dataclasses import asdict
from datetime import date from datetime import date, datetime
from typing import Dict, List, Optional from typing import Dict, List, Optional
import numpy as np import numpy as np

View File

@ -17,9 +17,17 @@ def render_log_viewer() -> None:
col1, col2 = st.columns(2) col1, col2 = st.columns(2)
with col1: with col1:
start_date = st.date_input("开始日期", value=date.today() - timedelta(days=7)) start_date = st.date_input(
"开始日期",
value=date.today() - timedelta(days=7),
key="log_view_start_date",
)
with col2: with col2:
end_date = st.date_input("结束日期", value=date.today()) end_date = st.date_input(
"结束日期",
value=date.today(),
key="log_view_end_date",
)
log_levels = ["ALL", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] log_levels = ["ALL", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
selected_level = st.selectbox("日志级别", log_levels, index=1) selected_level = st.selectbox("日志级别", log_levels, index=1)
@ -108,9 +116,17 @@ def render_log_viewer() -> None:
col3, col4 = st.columns(2) col3, col4 = st.columns(2)
with col3: with col3:
compare_date1 = st.date_input("对比日期1", value=date.today() - timedelta(days=1)) compare_date1 = st.date_input(
"对比日期1",
value=date.today() - timedelta(days=1),
key="log_view_compare_date1",
)
with col4: with col4:
compare_date2 = st.date_input("对比日期2", value=date.today()) compare_date2 = st.date_input(
"对比日期2",
value=date.today(),
key="log_view_compare_date2",
)
comparison_stage = st.selectbox("对比阶段", stages, key="compare_stage") comparison_stage = st.selectbox("对比阶段", stages, key="compare_stage")
st.write("选择需要比较的日志数量。") st.write("选择需要比较的日志数量。")