some ui improvements
This commit is contained in:
67
frontend.py
67
frontend.py
@@ -40,20 +40,43 @@ st.set_page_config(page_title="Airport Announcement System", page_icon="✈️")
|
||||
# Main interface
|
||||
st.title("Airport Announcement System ✈️")
|
||||
|
||||
# Predefined announcements section
|
||||
st.header("Predefined Announcements")
|
||||
col1, col2, col3 = st.columns(3)
|
||||
with col1:
|
||||
if st.button("Final Boarding Call"):
|
||||
announce("This is the final boarding call for flight LX-380 to New York", "Gate1")
|
||||
with col2:
|
||||
if st.button("Security Reminder"):
|
||||
announce("Please keep your luggage with you at all times", "Gate2")
|
||||
with col3:
|
||||
if st.button("Delay Notice"):
|
||||
announce("We regret to inform you of a 30-minute delay", "Gate1")
|
||||
# Announcements section
|
||||
with st.container():
|
||||
st.header("Announcements")
|
||||
|
||||
# Predefined announcements
|
||||
col1, col2, col3 = st.columns(3)
|
||||
with col1:
|
||||
if st.button("Final Boarding Call"):
|
||||
st.session_state.last_announcement = {
|
||||
"message": "This is the final boarding call for flight LX-380 to New York",
|
||||
"group": "Gate1"
|
||||
}
|
||||
with col2:
|
||||
if st.button("Security Reminder"):
|
||||
st.session_state.last_announcement = {
|
||||
"message": "Please keep your luggage with you at all times",
|
||||
"group": "Gate2"
|
||||
}
|
||||
with col3:
|
||||
if st.button("Delay Notice"):
|
||||
st.session_state.last_announcement = {
|
||||
"message": "We regret to inform you of a 30-minute delay",
|
||||
"group": "Gate1"
|
||||
}
|
||||
|
||||
st.markdown("---")
|
||||
# Custom announcement
|
||||
with st.form("custom_announcement"):
|
||||
# Get all groups
|
||||
groups = [group["name"] for group in st.session_state.endpoint_groups]
|
||||
selected_group = st.selectbox("Select announcement area", groups)
|
||||
message = st.text_area("Enter announcement text", "")
|
||||
|
||||
if st.form_submit_button("Make Announcement"):
|
||||
st.session_state.last_announcement = {
|
||||
"message": message,
|
||||
"group": selected_group
|
||||
}
|
||||
|
||||
# Configuration section in sidebar
|
||||
with st.sidebar:
|
||||
@@ -94,14 +117,10 @@ with st.sidebar:
|
||||
"languages": DEFAULT_LANGUAGES.copy()
|
||||
})
|
||||
|
||||
# Custom announcement section
|
||||
st.header("Custom Announcement")
|
||||
with st.form("custom_announcement"):
|
||||
# Get all groups
|
||||
groups = [group["name"] for group in st.session_state.endpoint_groups]
|
||||
selected_group = st.selectbox("Select announcement area", groups)
|
||||
message = st.text_area("Enter announcement text",
|
||||
"")
|
||||
|
||||
if st.form_submit_button("Make Announcement"):
|
||||
announce(message, selected_group)
|
||||
# Display announcement feedback at the bottom of the page
|
||||
if "last_announcement" in st.session_state:
|
||||
st.write("---")
|
||||
announce(
|
||||
st.session_state.last_announcement["message"],
|
||||
st.session_state.last_announcement["group"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user