import streamlit as st from frontend.app import pinecone_data_handler,common_functions # # Page Configuration common_functions.config_homepage() # common_functions.set_bg_image("src/frontend/images/health_care_baner.png") def render_admin_portal(): """ Renders the enhanced Admin Portal page with improved UI, navigation, and user guidance. Features: - Upsert data functionality with informative tips. - Delete records feature with enhanced warnings and confirmation prompts. """ # Header Section st.markdown( """

🛠️ Admin Portal

Manage your Pinecone database securely and efficiently.

""", unsafe_allow_html=True ) st.divider() # Data Manager Tabs DataManager = st.tabs(["📂 Pinecone Data Manager"])[0] with DataManager: Upsert, Delete = st.tabs(["🟢 Upsert Data", "🔴 Delete Records"]) # Upsert Section with Upsert: st.markdown( """

📥 Upsert Data

Use this section to insert or update records in Pinecone.

✅ Ensure your data is correctly formatted before uploading.

""", unsafe_allow_html=True ) st.divider() # Call Upsert Function pinecone_data_handler.upsert_data() # Delete Section with Delete: st.markdown( """

⚠️ Delete Records

Warning: Deleting data is irreversible.
Please confirm your action before proceeding.

""", unsafe_allow_html=True ) st.divider() pinecone_data_handler.delete_records() # Call the function to render the Admin Portal if __name__ == "__main__": render_admin_portal()