rawshal commited on
Commit
080b63d
Β·
verified Β·
1 Parent(s): 639c73a

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +14 -7
Home.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
 
3
  # ── 1. CONFIG & ASSETS ────────────────────────────────────────────────────────
4
  st.set_page_config(page_title="Wercore | App Generator", page_icon="🏒", layout="wide")
@@ -39,7 +40,6 @@ if not st.session_state.get("authenticated", False):
39
  st.title("πŸ”’ Wercore Portal")
40
  st.info("Please log in to access the reporting engines.")
41
 
42
- # Change "admin123" to whatever password you want your team to use
43
  password = st.text_input("Master Password", type="password")
44
  if st.button("Secure Login", type="primary", use_container_width=True):
45
  if password == "admin123":
@@ -54,21 +54,28 @@ st.title("Wercore App Generator")
54
  st.markdown("Select a reporting engine below to begin generating compliance documentation.")
55
  st.markdown("---")
56
 
57
- # ── 4. NAVIGATION GRID ────────────────────────────────────────────────────────
 
 
 
 
 
 
 
58
  col1, col2, col3 = st.columns(3)
59
 
60
  with col1:
61
- st.page_link("pages/1_Water_Tank_Report.py", label="Water Tank Disinfection", icon="πŸ’§")
62
  st.write("") # Spacer
63
- st.page_link("pages/4_Pipeline_Disinfection.py", label="Pipeline Disinfection", icon="🚰")
64
 
65
  with col2:
66
- st.page_link("pages/2_Pest_Control_Report.py", label="Pest Control Report", icon="πŸͺ³")
67
  st.write("") # Spacer
68
- st.page_link("pages/5_Site_Survey_Report.py", label="Site Survey", icon="πŸ“‹")
69
 
70
  with col3:
71
- st.page_link("pages/3_Termite_Control.py", label="Termite Control", icon="🐜")
72
 
73
  st.markdown("---")
74
  st.caption("Β© 2026 Sterdil Labs")
 
1
  import streamlit as st
2
+ import os
3
 
4
  # ── 1. CONFIG & ASSETS ────────────────────────────────────────────────────────
5
  st.set_page_config(page_title="Wercore | App Generator", page_icon="🏒", layout="wide")
 
40
  st.title("πŸ”’ Wercore Portal")
41
  st.info("Please log in to access the reporting engines.")
42
 
 
43
  password = st.text_input("Master Password", type="password")
44
  if st.button("Secure Login", type="primary", use_container_width=True):
45
  if password == "admin123":
 
54
  st.markdown("Select a reporting engine below to begin generating compliance documentation.")
55
  st.markdown("---")
56
 
57
+ # ── 4. NAVIGATION GRID (CRASH-PROOF) ──────────────────────────────────────────
58
+ # This function stops the app from crashing if a file name is misspelled
59
+ def safe_link(file_path, label, icon):
60
+ if os.path.exists(file_path):
61
+ st.page_link(file_path, label=label, icon=icon)
62
+ else:
63
+ st.warning(f"⚠️ **Missing File:** Please create `{file_path}` to activate this button.")
64
+
65
  col1, col2, col3 = st.columns(3)
66
 
67
  with col1:
68
+ safe_link("pages/1_Water_Tank_Report.py", "Water Tank Disinfection", "πŸ’§")
69
  st.write("") # Spacer
70
+ safe_link("pages/4_Pipeline_Disinfection.py", "Pipeline Disinfection", "🚰")
71
 
72
  with col2:
73
+ safe_link("pages/2_Pest_Control_Report.py", "Pest Control Report", "πŸͺ³")
74
  st.write("") # Spacer
75
+ safe_link("pages/5_Site_Survey_Report.py", "Site Survey", "πŸ“‹")
76
 
77
  with col3:
78
+ safe_link("pages/3_Termite_Control.py", "Termite Control", "🐜")
79
 
80
  st.markdown("---")
81
  st.caption("Β© 2026 Sterdil Labs")