Spaces:
Running
Running
Nguyễn Quốc Vỹ commited on
Commit ·
2ffdb62
1
Parent(s): e355040
Sửa lại giao diện
Browse files- frontend/app.py +4 -5
frontend/app.py
CHANGED
|
@@ -1017,10 +1017,9 @@ def show_admin_page():
|
|
| 1017 |
st.warning(stats["error"])
|
| 1018 |
else:
|
| 1019 |
st.metric("Tổng số chunks", stats.get("total_chunks", 0))
|
| 1020 |
-
|
| 1021 |
-
st.
|
| 1022 |
-
|
| 1023 |
-
with st.spinner("Đang đồng bộ tài liệu mới vào ChromaDB..."):
|
| 1024 |
ok, msg = reindex_all()
|
| 1025 |
if ok:
|
| 1026 |
st.success(msg)
|
|
@@ -1134,7 +1133,7 @@ with st.sidebar:
|
|
| 1134 |
|
| 1135 |
# Logout button
|
| 1136 |
st.markdown('<div class="logout-btn">', unsafe_allow_html=True)
|
| 1137 |
-
if st.button("
|
| 1138 |
for key in ["user", "conversations", "current_conv_id", "uploaded_pdf_text", "uploaded_pdf_name"]:
|
| 1139 |
if key in st.session_state:
|
| 1140 |
del st.session_state[key]
|
|
|
|
| 1017 |
st.warning(stats["error"])
|
| 1018 |
else:
|
| 1019 |
st.metric("Tổng số chunks", stats.get("total_chunks", 0))
|
| 1020 |
+
st.caption("Index tài liệu mới")
|
| 1021 |
+
if st.button("Cập nhật tài liệu mới"):
|
| 1022 |
+
with st.spinner("Đang đồng bộ tài liệu mới vào"):
|
|
|
|
| 1023 |
ok, msg = reindex_all()
|
| 1024 |
if ok:
|
| 1025 |
st.success(msg)
|
|
|
|
| 1133 |
|
| 1134 |
# Logout button
|
| 1135 |
st.markdown('<div class="logout-btn">', unsafe_allow_html=True)
|
| 1136 |
+
if st.button("Đăng xuất", key="logout_btn", use_container_width=True):
|
| 1137 |
for key in ["user", "conversations", "current_conv_id", "uploaded_pdf_text", "uploaded_pdf_name"]:
|
| 1138 |
if key in st.session_state:
|
| 1139 |
del st.session_state[key]
|