fix: XID 통계 페이지에서 전체 XID 코드가 보이지 않는 버그 수정
This commit is contained in:
@@ -925,11 +925,9 @@ def page_xid_stats():
|
|||||||
unsafe_allow_html=True)
|
unsafe_allow_html=True)
|
||||||
|
|
||||||
stats = get_xid_statistics()
|
stats = get_xid_statistics()
|
||||||
if not stats:
|
|
||||||
st.info("아직 XID 에러 데이터가 없습니다. 로그를 업로드하면 자동으로 축적됩니다.")
|
|
||||||
return
|
|
||||||
|
|
||||||
# 전체 통계 테이블
|
# 전체 통계 테이블 (분석 이력이 존재할 때만 표시)
|
||||||
|
if stats:
|
||||||
sev_emoji = {"critical": "🔴", "warning": "🟡", "info": "🟢"}
|
sev_emoji = {"critical": "🔴", "warning": "🟡", "info": "🟢"}
|
||||||
stat_data = [{
|
stat_data = [{
|
||||||
"XID": s["xid_code"],
|
"XID": s["xid_code"],
|
||||||
@@ -940,13 +938,16 @@ def page_xid_stats():
|
|||||||
"최초 발견": s["first_seen"],
|
"최초 발견": s["first_seen"],
|
||||||
"최근 발견": s["last_seen"],
|
"최근 발견": s["last_seen"],
|
||||||
} for s in stats]
|
} for s in stats]
|
||||||
|
|
||||||
st.dataframe(pd.DataFrame(stat_data), use_container_width=True, hide_index=True)
|
st.dataframe(pd.DataFrame(stat_data), use_container_width=True, hide_index=True)
|
||||||
|
else:
|
||||||
|
st.info("아직 분석된 XID 에러 통계 데이터가 없습니다. 로그를 업로드하면 통계가 자동으로 축적됩니다.")
|
||||||
|
|
||||||
# XID 코드별 상세 조회
|
# XID 코드별 상세 조회 (실제 분석 이력과 무관하게 사전의 전체 172종 XID를 대상으로 조회 가능하도록 변경)
|
||||||
st.markdown("---")
|
st.markdown("---")
|
||||||
st.subheader("🔍 XID 코드 상세 조회")
|
st.subheader("🔍 XID 코드 상세 조회")
|
||||||
xid_codes = [s["xid_code"] for s in stats]
|
|
||||||
|
# XID 데이터베이스에 등록된 전체 XID 키(숫자 형태)를 오름차순으로 정렬하여 드롭다운 리스트 옵션으로 제공
|
||||||
|
xid_codes = sorted([int(k) for k in XID_DB["xid_errors"].keys() if k.isdigit()])
|
||||||
if xid_codes:
|
if xid_codes:
|
||||||
selected_xid = st.selectbox("XID 코드 선택", xid_codes,
|
selected_xid = st.selectbox("XID 코드 선택", xid_codes,
|
||||||
format_func=lambda x: f"XID {x}: {XID_DB['xid_errors'].get(str(x), {}).get('name', 'Unknown')}")
|
format_func=lambda x: f"XID {x}: {XID_DB['xid_errors'].get(str(x), {}).get('name', 'Unknown')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user