Nguyễn Quốc Vỹ commited on
Commit
2ffdb62
·
1 Parent(s): e355040

Sửa lại giao diện

Browse files
Files changed (1) hide show
  1. 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
- st.caption(f"Collection: {stats.get('collection_name')} | Thư mục: {stats.get('persist_dir', '')}")
1021
- st.caption("Nút bên dưới chỉ index tài liệu mới, bỏ qua tài liệu/chunks đã có để chạy nhanh hơn.")
1022
- if st.button("Đồng bộ chỉ mục (chỉ tài liệu mới)", type="primary"):
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("🚪 Đăng xuất", key="logout_btn", use_container_width=True):
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]