Spaces:
Sleeping
Sleeping
Added map, updated settings
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import pandas as pd
|
|
4 |
import streamlit_authenticator as stauth
|
5 |
import yaml
|
6 |
from yaml.loader import SafeLoader
|
|
|
7 |
|
8 |
# from langchain.chat_models import ChatAnthropic
|
9 |
# from langchain.callbacks.base import BaseCallbackHandler
|
@@ -128,6 +129,66 @@ def get_fly_situation_history(canteen):
|
|
128 |
|
129 |
return fly_situation_history
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
# # Streaming LLM output class
|
133 |
# class StreamHandler(BaseCallbackHandler):
|
@@ -146,7 +207,15 @@ def get_fly_situation_history(canteen):
|
|
146 |
# raise ValueError(f'Invalid display_method: {self.display_method}')
|
147 |
|
148 |
|
|
|
149 |
st.set_page_config(layout="centered")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
# Import configuration file for user authentication
|
152 |
with open('credentials.yaml') as file:
|
@@ -184,7 +253,7 @@ if st.session_state['authentication_status'] is None:
|
|
184 |
if st.session_state['authentication_status']:
|
185 |
|
186 |
# Streamlit app start
|
187 |
-
st.title("Fly Situation Monitoring App")
|
188 |
st.markdown("Keeping You Informed, Keeping Flies at Bay")
|
189 |
st.write('\n')
|
190 |
|
@@ -214,21 +283,33 @@ if st.session_state['authentication_status']:
|
|
214 |
|
215 |
# Alert level
|
216 |
if fly_situation["fly_count"] > 20:
|
217 |
-
alert_level = "High"
|
218 |
alert_colour = "red"
|
219 |
elif fly_situation["fly_count"] > 10:
|
220 |
-
alert_level = "Moderate"
|
221 |
alert_colour = "orange"
|
222 |
else:
|
223 |
-
alert_level = "Low"
|
224 |
alert_colour = "green"
|
225 |
st.markdown(f"<h2 style='color:{alert_colour}; text-align: left'>Alert Level: {alert_level}</h3>", unsafe_allow_html=True)
|
226 |
st.markdown('---')
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
# Feedback
|
229 |
st.header("Feedback")
|
230 |
# Gather feedback
|
231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
if st.button("Submit Feedback"):
|
233 |
st.success("Feedback submitted successfully!")
|
234 |
st.write('\n')
|
@@ -237,7 +318,7 @@ if st.session_state['authentication_status']:
|
|
237 |
|
238 |
# Tab 2: History
|
239 |
with tab2:
|
240 |
-
st.
|
241 |
|
242 |
# Get history data
|
243 |
fly_situation_history = get_fly_situation_history(canteen)
|
@@ -248,7 +329,7 @@ if st.session_state['authentication_status']:
|
|
248 |
sum_by_timestamp["timestamp"] = pd.to_datetime(sum_by_timestamp["timestamp"])
|
249 |
|
250 |
# Plot the time series using Plotly Express
|
251 |
-
fig = px.line(sum_by_timestamp, x="timestamp", y="fly_count",
|
252 |
st.plotly_chart(fig)
|
253 |
|
254 |
# Question-and-Answer
|
@@ -257,8 +338,8 @@ if st.session_state['authentication_status']:
|
|
257 |
submit = st.form_submit_button("Submit")
|
258 |
if prompt:
|
259 |
with st.spinner("Generating..."):
|
260 |
-
pass
|
261 |
-
|
262 |
# Logout
|
263 |
logout_col1, logout_col2 = st.columns([6,1])
|
264 |
with logout_col2:
|
@@ -266,6 +347,11 @@ if st.session_state['authentication_status']:
|
|
266 |
st.write('\n')
|
267 |
st.write('\n')
|
268 |
authenticator.logout('Logout', 'main')
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
else:
|
271 |
# Tabs
|
@@ -285,21 +371,33 @@ if st.session_state['authentication_status']:
|
|
285 |
|
286 |
# Alert
|
287 |
if fly_situation["fly_count"] > 20:
|
288 |
-
alert_level = "High"
|
289 |
alert_colour = "red"
|
290 |
elif fly_situation["fly_count"] > 10:
|
291 |
-
alert_level = "Moderate"
|
292 |
alert_colour = "orange"
|
293 |
else:
|
294 |
-
alert_level = "Low"
|
295 |
alert_colour = "green"
|
296 |
st.markdown(f"<h2 style='color:{alert_colour}; text-align: left'>Alert Level: {alert_level}</h3>", unsafe_allow_html=True)
|
297 |
st.markdown('---')
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
# Feedback
|
300 |
st.header("Feedback")
|
301 |
# Gather feedback
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
if st.button("Submit Feedback"):
|
304 |
st.success("Feedback submitted successfully!")
|
305 |
st.write('\n')
|
@@ -309,7 +407,8 @@ if st.session_state['authentication_status']:
|
|
309 |
|
310 |
# Tab 2: History
|
311 |
with tab2:
|
312 |
-
|
|
|
313 |
# Select sensor
|
314 |
selected_sensor = st.selectbox("Select Sensor:", ["All", "Sensor 1", "Sensor 2", "Sensor 3"])
|
315 |
# Get history data
|
@@ -321,8 +420,21 @@ if st.session_state['authentication_status']:
|
|
321 |
sum_by_timestamp = df.groupby('timestamp')['fly_count'].sum().reset_index()
|
322 |
sum_by_timestamp["timestamp"] = pd.to_datetime(sum_by_timestamp["timestamp"])
|
323 |
# Plot the time series using Plotly Express
|
324 |
-
fig = px.line(sum_by_timestamp, x="timestamp", y="fly_count",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
st.plotly_chart(fig)
|
|
|
326 |
|
327 |
# Question-and-Answer
|
328 |
with st.form("form"):
|
@@ -334,26 +446,51 @@ if st.session_state['authentication_status']:
|
|
334 |
|
335 |
# Tab 3: Control System
|
336 |
with tab3:
|
337 |
-
st.write('\n')
|
338 |
-
|
339 |
# Enable/disable automatic pest control system
|
340 |
-
|
|
|
|
|
341 |
st.write('\n')
|
342 |
if not automatic_control_enabled:
|
343 |
disabled = False
|
344 |
else:
|
345 |
disabled = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
# Accoustic
|
347 |
accoustic = st.selectbox("Accoustic Audio", ["Audio 1", "Audio 2", "Audio 3"], disabled=disabled)
|
348 |
st.write('\n')
|
349 |
|
|
|
350 |
# Time interval for pheremones discharge in minutes)
|
|
|
351 |
pheremones_interval = st.slider("Pheremones Discharge Interval (minutes)", min_value=5, max_value=60, value=15, step=5, disabled=disabled)
|
352 |
st.write('\n')
|
353 |
|
|
|
|
|
354 |
# Pest activity threshold for alerts
|
355 |
pest_activity_threshold = st.slider("Fly Count Threshold to Send Out Alerts", min_value=0, max_value=100, value=30, step=5, disabled=disabled)
|
356 |
st.write('\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
|
358 |
# Logout
|
359 |
logout_col1, logout_col2 = st.columns([6,1])
|
@@ -362,5 +499,10 @@ if st.session_state['authentication_status']:
|
|
362 |
st.write('\n')
|
363 |
st.write('\n')
|
364 |
authenticator.logout('Logout', 'main')
|
|
|
|
|
|
|
|
|
|
|
365 |
|
366 |
|
|
|
4 |
import streamlit_authenticator as stauth
|
5 |
import yaml
|
6 |
from yaml.loader import SafeLoader
|
7 |
+
import datetime
|
8 |
|
9 |
# from langchain.chat_models import ChatAnthropic
|
10 |
# from langchain.callbacks.base import BaseCallbackHandler
|
|
|
129 |
|
130 |
return fly_situation_history
|
131 |
|
132 |
+
# Function to get dataframe of camera locations
|
133 |
+
def get_camera_locations(canteen):
|
134 |
+
if canteen == 'Frontier':
|
135 |
+
camera_locations = pd.DataFrame({
|
136 |
+
"latitude": [1.2963134225592299, 1.2965099487866827, 1.296561127489237],
|
137 |
+
"longitude": [103.78033553238319, 103.78067954132742, 103.7807614482189],
|
138 |
+
"size": [1 for i in range(3)]
|
139 |
+
})
|
140 |
+
elif canteen == 'Deck':
|
141 |
+
camera_locations = pd.DataFrame({
|
142 |
+
"latitude": [1.2948580016451805, 1.2947091254796532, 1.2944617283028779],
|
143 |
+
"longitude": [103.77238596429575, 103.77266955821814, 103.77246151634456],
|
144 |
+
"size": [1 for i in range(3)]
|
145 |
+
})
|
146 |
+
|
147 |
+
return camera_locations
|
148 |
+
|
149 |
+
def get_pheremone_levels(sensor):
|
150 |
+
pheremone_levels_history = [
|
151 |
+
{"timestamp": "2023-11-10 11:00:00", "pheremone_level": 75, "sensor":1},
|
152 |
+
{"timestamp": "2023-11-10 11:05:00", "pheremone_level": 75, "sensor": 1},
|
153 |
+
{"timestamp": "2023-11-10 11:10:00", "pheremone_level": 74, "sensor": 1},
|
154 |
+
{"timestamp": "2023-11-10 11:15:00", "pheremone_level": 74, "sensor": 1},
|
155 |
+
{"timestamp": "2023-11-10 11:20:00", "pheremone_level": 74, "sensor": 1},
|
156 |
+
{"timestamp": "2023-11-10 11:25:00", "pheremone_level": 74, "sensor": 1},
|
157 |
+
{"timestamp": "2023-11-10 11:30:00", "pheremone_level": 73, "sensor": 1},
|
158 |
+
{"timestamp": "2023-11-10 11:35:00", "pheremone_level": 72, "sensor": 1},
|
159 |
+
{"timestamp": "2023-11-10 11:40:00", "pheremone_level": 71, "sensor": 1},
|
160 |
+
{"timestamp": "2023-11-10 11:45:00", "pheremone_level": 65, "sensor": 1},
|
161 |
+
{"timestamp": "2023-11-10 11:50:00", "pheremone_level": 63, "sensor": 1},
|
162 |
+
{"timestamp": "2023-11-10 11:55:00", "pheremone_level": 62, "sensor": 1},
|
163 |
+
{"timestamp": "2023-11-10 12:00:00", "pheremone_level": 58, "sensor": 1},
|
164 |
+
{"timestamp": "2023-11-10 11:00:00", "pheremone_level": 95, "sensor": 2},
|
165 |
+
{"timestamp": "2023-11-10 11:05:00", "pheremone_level": 91, "sensor": 2},
|
166 |
+
{"timestamp": "2023-11-10 11:10:00", "pheremone_level": 91, "sensor": 2},
|
167 |
+
{"timestamp": "2023-11-10 11:15:00", "pheremone_level": 90, "sensor": 2},
|
168 |
+
{"timestamp": "2023-11-10 11:20:00", "pheremone_level": 90, "sensor": 2},
|
169 |
+
{"timestamp": "2023-11-10 11:25:00", "pheremone_level": 90, "sensor": 2},
|
170 |
+
{"timestamp": "2023-11-10 11:30:00", "pheremone_level": 90, "sensor": 2},
|
171 |
+
{"timestamp": "2023-11-10 11:35:00", "pheremone_level": 90, "sensor": 2},
|
172 |
+
{"timestamp": "2023-11-10 11:40:00", "pheremone_level": 87, "sensor": 2},
|
173 |
+
{"timestamp": "2023-11-10 11:45:00", "pheremone_level": 84, "sensor": 2},
|
174 |
+
{"timestamp": "2023-11-10 11:50:00", "pheremone_level": 80, "sensor": 2},
|
175 |
+
{"timestamp": "2023-11-10 11:55:00", "pheremone_level": 73, "sensor": 2},
|
176 |
+
{"timestamp": "2023-11-10 12:00:00", "pheremone_level": 72, "sensor": 2},
|
177 |
+
{"timestamp": "2023-11-10 11:00:00", "pheremone_level": 41, "sensor": 3},
|
178 |
+
{"timestamp": "2023-11-10 11:05:00", "pheremone_level": 41, "sensor": 3},
|
179 |
+
{"timestamp": "2023-11-10 11:10:00", "pheremone_level": 40, "sensor": 3},
|
180 |
+
{"timestamp": "2023-11-10 11:15:00", "pheremone_level": 40, "sensor": 3},
|
181 |
+
{"timestamp": "2023-11-10 11:20:00", "pheremone_level": 39, "sensor": 3},
|
182 |
+
{"timestamp": "2023-11-10 11:25:00", "pheremone_level": 38, "sensor": 3},
|
183 |
+
{"timestamp": "2023-11-10 11:30:00", "pheremone_level": 38, "sensor": 3},
|
184 |
+
{"timestamp": "2023-11-10 11:35:00", "pheremone_level": 35, "sensor": 3},
|
185 |
+
{"timestamp": "2023-11-10 11:40:00", "pheremone_level": 34, "sensor": 3},
|
186 |
+
{"timestamp": "2023-11-10 11:45:00", "pheremone_level": 33, "sensor": 3},
|
187 |
+
{"timestamp": "2023-11-10 11:50:00", "pheremone_level": 33, "sensor": 3},
|
188 |
+
{"timestamp": "2023-11-10 11:55:00", "pheremone_level": 30, "sensor": 3},
|
189 |
+
{"timestamp": "2023-11-10 12:00:00", "pheremone_level": 26, "sensor": 3},
|
190 |
+
]
|
191 |
+
return pheremone_levels_history
|
192 |
|
193 |
# # Streaming LLM output class
|
194 |
# class StreamHandler(BaseCallbackHandler):
|
|
|
207 |
# raise ValueError(f'Invalid display_method: {self.display_method}')
|
208 |
|
209 |
|
210 |
+
# Start of Streamlit Apps
|
211 |
st.set_page_config(layout="centered")
|
212 |
+
hide_streamlit_style = '''
|
213 |
+
<style>
|
214 |
+
#MainMenu {visibility: show;}
|
215 |
+
footer {visibility: hidden;}
|
216 |
+
</style>
|
217 |
+
'''
|
218 |
+
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
219 |
|
220 |
# Import configuration file for user authentication
|
221 |
with open('credentials.yaml') as file:
|
|
|
253 |
if st.session_state['authentication_status']:
|
254 |
|
255 |
# Streamlit app start
|
256 |
+
st.title("Fly Situation Monitoring App πͺ°")
|
257 |
st.markdown("Keeping You Informed, Keeping Flies at Bay")
|
258 |
st.write('\n')
|
259 |
|
|
|
283 |
|
284 |
# Alert level
|
285 |
if fly_situation["fly_count"] > 20:
|
286 |
+
alert_level = "High π΄"
|
287 |
alert_colour = "red"
|
288 |
elif fly_situation["fly_count"] > 10:
|
289 |
+
alert_level = "Moderate π "
|
290 |
alert_colour = "orange"
|
291 |
else:
|
292 |
+
alert_level = "Low π’"
|
293 |
alert_colour = "green"
|
294 |
st.markdown(f"<h2 style='color:{alert_colour}; text-align: left'>Alert Level: {alert_level}</h3>", unsafe_allow_html=True)
|
295 |
st.markdown('---')
|
296 |
|
297 |
+
# Camera locations
|
298 |
+
st.header("Smart Camera Locations")
|
299 |
+
camera_locations = get_camera_locations(canteen)
|
300 |
+
st.map(camera_locations, size='size', zoom=18)
|
301 |
+
st.markdown('---')
|
302 |
+
|
303 |
# Feedback
|
304 |
st.header("Feedback")
|
305 |
# Gather feedback
|
306 |
+
feedback_col1, feedback_col2 = st.columns(2)
|
307 |
+
with feedback_col1:
|
308 |
+
user_feedback = st.text_area("Provide Feedback on the Fly Situation:")
|
309 |
+
with feedback_col2:
|
310 |
+
uploaded_files = st.file_uploader("Upload a Photo", accept_multiple_files=True, type=['jpg', 'png'])
|
311 |
+
for uploaded_file in uploaded_files:
|
312 |
+
st.image(uploaded_file)
|
313 |
if st.button("Submit Feedback"):
|
314 |
st.success("Feedback submitted successfully!")
|
315 |
st.write('\n')
|
|
|
318 |
|
319 |
# Tab 2: History
|
320 |
with tab2:
|
321 |
+
st.subheader("Fly Count Over Time")
|
322 |
|
323 |
# Get history data
|
324 |
fly_situation_history = get_fly_situation_history(canteen)
|
|
|
329 |
sum_by_timestamp["timestamp"] = pd.to_datetime(sum_by_timestamp["timestamp"])
|
330 |
|
331 |
# Plot the time series using Plotly Express
|
332 |
+
fig = px.line(sum_by_timestamp, x="timestamp", y="fly_count", labels={"fly_count": "Fly Count", "timestamp": "Timestamp"})
|
333 |
st.plotly_chart(fig)
|
334 |
|
335 |
# Question-and-Answer
|
|
|
338 |
submit = st.form_submit_button("Submit")
|
339 |
if prompt:
|
340 |
with st.spinner("Generating..."):
|
341 |
+
pass
|
342 |
+
|
343 |
# Logout
|
344 |
logout_col1, logout_col2 = st.columns([6,1])
|
345 |
with logout_col2:
|
|
|
347 |
st.write('\n')
|
348 |
st.write('\n')
|
349 |
authenticator.logout('Logout', 'main')
|
350 |
+
|
351 |
+
# Footer Credits
|
352 |
+
st.markdown('##')
|
353 |
+
st.markdown("---")
|
354 |
+
st.markdown("Created with β€οΈ by HS2912 W4 Group 2")
|
355 |
|
356 |
else:
|
357 |
# Tabs
|
|
|
371 |
|
372 |
# Alert
|
373 |
if fly_situation["fly_count"] > 20:
|
374 |
+
alert_level = "High π΄"
|
375 |
alert_colour = "red"
|
376 |
elif fly_situation["fly_count"] > 10:
|
377 |
+
alert_level = "Moderate π "
|
378 |
alert_colour = "orange"
|
379 |
else:
|
380 |
+
alert_level = "Low π’"
|
381 |
alert_colour = "green"
|
382 |
st.markdown(f"<h2 style='color:{alert_colour}; text-align: left'>Alert Level: {alert_level}</h3>", unsafe_allow_html=True)
|
383 |
st.markdown('---')
|
384 |
|
385 |
+
# Camera locations
|
386 |
+
st.header("Smart Camera Locations")
|
387 |
+
camera_locations = get_camera_locations(canteen)
|
388 |
+
st.map(camera_locations, size='size', zoom=18)
|
389 |
+
st.markdown('---')
|
390 |
+
|
391 |
# Feedback
|
392 |
st.header("Feedback")
|
393 |
# Gather feedback
|
394 |
+
feedback_col1, feedback_col2 = st.columns(2)
|
395 |
+
with feedback_col1:
|
396 |
+
user_feedback = st.text_area("Provide Feedback on the Fly Situation:")
|
397 |
+
with feedback_col2:
|
398 |
+
uploaded_files = st.file_uploader("Upload a Photo", accept_multiple_files=True, type=['jpg', 'png'])
|
399 |
+
for uploaded_file in uploaded_files:
|
400 |
+
st.image(uploaded_file)
|
401 |
if st.button("Submit Feedback"):
|
402 |
st.success("Feedback submitted successfully!")
|
403 |
st.write('\n')
|
|
|
407 |
|
408 |
# Tab 2: History
|
409 |
with tab2:
|
410 |
+
# Fly count over time
|
411 |
+
st.subheader("Fly Count Over Time")
|
412 |
# Select sensor
|
413 |
selected_sensor = st.selectbox("Select Sensor:", ["All", "Sensor 1", "Sensor 2", "Sensor 3"])
|
414 |
# Get history data
|
|
|
420 |
sum_by_timestamp = df.groupby('timestamp')['fly_count'].sum().reset_index()
|
421 |
sum_by_timestamp["timestamp"] = pd.to_datetime(sum_by_timestamp["timestamp"])
|
422 |
# Plot the time series using Plotly Express
|
423 |
+
fig = px.line(sum_by_timestamp, x="timestamp", y="fly_count", labels={"fly_count": "Fly Count", "timestamp": "Timestamp"})
|
424 |
+
st.plotly_chart(fig)
|
425 |
+
|
426 |
+
# Pheremones level
|
427 |
+
st.subheader("Pheremone Level Over Time")
|
428 |
+
selected_sensor_level = st.selectbox("Select Sensor:", ["Sensor 1", "Sensor 2", "Sensor 3"])
|
429 |
+
# Get history data
|
430 |
+
sensor_pheremone_history = get_pheremone_levels(selected_sensor_level)
|
431 |
+
pheremone_df = pd.DataFrame(sensor_pheremone_history)
|
432 |
+
pheremone_df = pheremone_df[pheremone_df["sensor"] == int(selected_sensor_level[-1])]
|
433 |
+
pheremone_df['timestamp'] = pd.to_datetime(pheremone_df['timestamp'])
|
434 |
+
# Plot the time series using Plotly Express
|
435 |
+
fig = px.line(pheremone_df, x="timestamp", y="pheremone_level", labels={"pheremone_level": "Pheremone Level", "timestamp": "Timestamp"})
|
436 |
st.plotly_chart(fig)
|
437 |
+
|
438 |
|
439 |
# Question-and-Answer
|
440 |
with st.form("form"):
|
|
|
446 |
|
447 |
# Tab 3: Control System
|
448 |
with tab3:
|
|
|
|
|
449 |
# Enable/disable automatic pest control system
|
450 |
+
st.header("System Settings")
|
451 |
+
automatic_control_enabled = st.toggle("Enable Automatic Pest Control", value=True)
|
452 |
+
st.write('\n')
|
453 |
st.write('\n')
|
454 |
if not automatic_control_enabled:
|
455 |
disabled = False
|
456 |
else:
|
457 |
disabled = True
|
458 |
+
|
459 |
+
# Camera
|
460 |
+
st.subheader("Smart Camera/Sensors")
|
461 |
+
sensor1 = st.toggle("Enable Sensor 1", value=True, disabled=disabled, key='deck_sensor_1')
|
462 |
+
sensor2 = st.toggle("Enable Sensor 2", value=True, disabled=disabled, key='deck_sensor_2')
|
463 |
+
sensor3 = st.toggle("Enable Sensor 3", value=True, disabled=disabled, key='deck_sensor_3')
|
464 |
+
st.write('\n')
|
465 |
+
|
466 |
+
# Audio
|
467 |
+
st.subheader("Audio")
|
468 |
# Accoustic
|
469 |
accoustic = st.selectbox("Accoustic Audio", ["Audio 1", "Audio 2", "Audio 3"], disabled=disabled)
|
470 |
st.write('\n')
|
471 |
|
472 |
+
# Pheremones
|
473 |
# Time interval for pheremones discharge in minutes)
|
474 |
+
st.subheader("Pheremones")
|
475 |
pheremones_interval = st.slider("Pheremones Discharge Interval (minutes)", min_value=5, max_value=60, value=15, step=5, disabled=disabled)
|
476 |
st.write('\n')
|
477 |
|
478 |
+
# Alerts
|
479 |
+
st.subheader('Alerts')
|
480 |
# Pest activity threshold for alerts
|
481 |
pest_activity_threshold = st.slider("Fly Count Threshold to Send Out Alerts", min_value=0, max_value=100, value=30, step=5, disabled=disabled)
|
482 |
st.write('\n')
|
483 |
+
# Instant alerts for pest sightings or unusual activity
|
484 |
+
st.markdown('<h5>Instant alert</h3>', unsafe_allow_html=True)
|
485 |
+
if st.button("Send Pest Alert", disabled=disabled):
|
486 |
+
st.success("Pest alert sent!")
|
487 |
+
st.write('\n')
|
488 |
+
# Notifications for upcoming preventive measures or scheduled treatments
|
489 |
+
st.markdown('<h5>Schedule notification for upcoming treatment day</h3>', unsafe_allow_html=True)
|
490 |
+
upcoming_event_date = st.date_input("Schedule Date", disabled=disabled)
|
491 |
+
upcoming_event_time = st.time_input("Set time for alert", disabled=disabled)
|
492 |
+
if st.button("Schedule Notification", disabled=disabled):
|
493 |
+
st.success(f"Notification scheduled for {upcoming_event_date} {upcoming_event_time}")
|
494 |
|
495 |
# Logout
|
496 |
logout_col1, logout_col2 = st.columns([6,1])
|
|
|
499 |
st.write('\n')
|
500 |
st.write('\n')
|
501 |
authenticator.logout('Logout', 'main')
|
502 |
+
|
503 |
+
# Footer Credits
|
504 |
+
st.markdown('##')
|
505 |
+
st.markdown("---")
|
506 |
+
st.markdown("Created with β€οΈ by HS2912 W4 Group 2")
|
507 |
|
508 |
|