Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def get_filtered_data(lab_site, equipment_type, date_start, date_end):
|
|
54 |
query += f" AND Lab__c = '{lab_site}'"
|
55 |
if equipment_type != "All":
|
56 |
query += f" AND Equipment_Type__c = '{equipment_type}'"
|
57 |
-
query += " LIMIT
|
58 |
return fetch_salesforce_data(sf, query)
|
59 |
|
60 |
def main():
|
@@ -65,15 +65,13 @@ def main():
|
|
65 |
st.title("Multi-Device LabOps Dashboard")
|
66 |
|
67 |
# Filters
|
68 |
-
col1, col2
|
69 |
with col1:
|
70 |
lab_site = st.selectbox("Select Lab Site", ["All", "Lab1", "Lab2", "Lab3"])
|
71 |
with col2:
|
72 |
equipment_type = st.selectbox("Equipment Type", ["All", "Cell Analyzer", "Weight Log", "UV Verification"])
|
73 |
-
|
74 |
-
|
75 |
-
default_end = datetime.now()
|
76 |
-
date_range = st.date_input("Date Range", [default_start, default_end])
|
77 |
|
78 |
# Validate date range
|
79 |
if len(date_range) != 2:
|
|
|
54 |
query += f" AND Lab__c = '{lab_site}'"
|
55 |
if equipment_type != "All":
|
56 |
query += f" AND Equipment_Type__c = '{equipment_type}'"
|
57 |
+
query += " LIMIT 100" # Reduced for faster load in Hugging Face Spaces
|
58 |
return fetch_salesforce_data(sf, query)
|
59 |
|
60 |
def main():
|
|
|
65 |
st.title("Multi-Device LabOps Dashboard")
|
66 |
|
67 |
# Filters
|
68 |
+
col1, col2 = st.columns(2)
|
69 |
with col1:
|
70 |
lab_site = st.selectbox("Select Lab Site", ["All", "Lab1", "Lab2", "Lab3"])
|
71 |
with col2:
|
72 |
equipment_type = st.selectbox("Equipment Type", ["All", "Cell Analyzer", "Weight Log", "UV Verification"])
|
73 |
+
|
74 |
+
date_range = st.date_input("Date Range", [datetime.now() - timedelta(days=7), datetime.now()])
|
|
|
|
|
75 |
|
76 |
# Validate date range
|
77 |
if len(date_range) != 2:
|