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
|
# Main interface
|
||||||
st.title("Airport Announcement System ✈️")
|
st.title("Airport Announcement System ✈️")
|
||||||
|
|
||||||
# Predefined announcements section
|
# Announcements section
|
||||||
st.header("Predefined Announcements")
|
with st.container():
|
||||||
col1, col2, col3 = st.columns(3)
|
st.header("Announcements")
|
||||||
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")
|
|
||||||
|
|
||||||
st.markdown("---")
|
# 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"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
# Configuration section in sidebar
|
||||||
with st.sidebar:
|
with st.sidebar:
|
||||||
@@ -94,14 +117,10 @@ with st.sidebar:
|
|||||||
"languages": DEFAULT_LANGUAGES.copy()
|
"languages": DEFAULT_LANGUAGES.copy()
|
||||||
})
|
})
|
||||||
|
|
||||||
# Custom announcement section
|
# Display announcement feedback at the bottom of the page
|
||||||
st.header("Custom Announcement")
|
if "last_announcement" in st.session_state:
|
||||||
with st.form("custom_announcement"):
|
st.write("---")
|
||||||
# Get all groups
|
announce(
|
||||||
groups = [group["name"] for group in st.session_state.endpoint_groups]
|
st.session_state.last_announcement["message"],
|
||||||
selected_group = st.selectbox("Select announcement area", groups)
|
st.session_state.last_announcement["group"]
|
||||||
message = st.text_area("Enter announcement text",
|
)
|
||||||
"")
|
|
||||||
|
|
||||||
if st.form_submit_button("Make Announcement"):
|
|
||||||
announce(message, selected_group)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user