feat: XID 권장 조치사항의 영문 원문 및 한글 번역 동시 제공 및 UI 이원화(st.tabs)

This commit is contained in:
unknown
2026-06-24 16:41:01 +09:00
parent 2ab9fac46c
commit 5cd48c405b
3 changed files with 559 additions and 177 deletions
+36 -4
View File
@@ -706,8 +706,20 @@ def page_analyze():
st.markdown(f"**PCI 주소:** `{event.pci_address}`")
st.markdown(f"**설명:** {event.description}")
st.markdown("**권장 조치:**")
for ln in event.action.split("\n"):
st.markdown(f" {ln}")
action_ko = getattr(event, "action_ko", event.action)
action_en = getattr(event, "action_en", "")
if action_ko and action_en:
act_tab1, act_tab2 = st.tabs(["🇰🇷 한글 가이드", "🇺🇸 영문 가이드"])
with act_tab1:
for ln in action_ko.split("\n"):
st.markdown(f" {ln}")
with act_tab2:
for ln in action_en.split("\n"):
st.markdown(f" {ln}")
else:
for ln in action_ko.split("\n"):
st.markdown(f" {ln}")
# 커널 이벤트
st.markdown("---")
@@ -957,7 +969,17 @@ def page_xid_stats():
st.markdown(f"### {sev.get('emoji', '')} XID {selected_xid}: {xid_info['name']}")
st.markdown(f"**설명:** {xid_info['description']}")
st.markdown("**권장 조치:**")
st.markdown(xid_info["action"])
action_ko = xid_info.get("action_ko", xid_info.get("action", ""))
action_en = xid_info.get("action_en", "")
if action_ko and action_en:
tab_ko, tab_en = st.tabs(["🇰🇷 한글 가이드", "🇺🇸 영문 가이드"])
with tab_ko:
st.markdown(action_ko)
with tab_en:
st.markdown(action_en)
else:
st.markdown(action_ko)
# 전체 XID DB 조회
st.markdown("---")
@@ -970,7 +992,17 @@ def page_xid_stats():
st.markdown(f"심각도: {sev.get('label', xid_info['severity'])}")
st.markdown(xid_info['description'])
st.markdown("**권장 조치:**")
st.markdown(xid_info["action"])
action_ko = xid_info.get("action_ko", xid_info.get("action", ""))
action_en = xid_info.get("action_en", "")
if action_ko and action_en:
tab_ko, tab_en = st.tabs(["🇰🇷 한글 가이드", "🇺🇸 영문 가이드"])
with tab_ko:
st.markdown(action_ko)
with tab_en:
st.markdown(action_en)
else:
st.markdown(action_ko)
else:
st.warning(f"XID {xid_lookup}에 대한 정보가 데이터베이스에 없습니다.")