Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -102,17 +102,30 @@ def main():
|
|
102 |
|
103 |
""")
|
104 |
st.sidebar.write("Feel free to check out my other apps:")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
# Dropdown menu for other app links
|
107 |
-
app_links = {
|
108 |
-
"Movie-mind": "https://movie-mind.streamlit.app/",
|
109 |
-
"find-fake-news": "https://find-fake-news.streamlit.app/"
|
110 |
-
}
|
111 |
-
selected_app = st.sidebar.selectbox("Select an App", list(app_links.keys()))
|
112 |
-
if st.sidebar.button("Go to App"):
|
113 |
-
st.sidebar.write(f"You are now redirected to {selected_app}")
|
114 |
-
st.sidebar.write(f"Link: {app_links[selected_app]}")
|
115 |
-
st.sidebar.success("Redirected successfully!")
|
116 |
|
117 |
st.sidebar.write("In case the apps are down, because of less usage")
|
118 |
st.sidebar.write("Kindly reach out to me @ [email protected]")
|
|
|
102 |
|
103 |
""")
|
104 |
st.sidebar.write("Feel free to check out my other apps:")
|
105 |
+
|
106 |
+
|
107 |
+
# Create a form using st.form context manager
|
108 |
+
with st.form("app_selection_form"):
|
109 |
+
st.write("Select an App:")
|
110 |
+
app_links = {
|
111 |
+
"Movie-mind": "https://movie-mind.streamlit.app/",
|
112 |
+
"find-fake-news": "https://find-fake-news.streamlit.app/"
|
113 |
+
}
|
114 |
+
selected_app = st.selectbox("Choose an App", list(app_links.keys()))
|
115 |
+
|
116 |
+
submitted_button = st.form_submit_button("Go to App")
|
117 |
+
|
118 |
+
# Handle form submission
|
119 |
+
if submitted_button:
|
120 |
+
selected_app_url = app_links.get(selected_app)
|
121 |
+
if selected_app_url:
|
122 |
+
st.sidebar.success("Redirected successfully!")
|
123 |
+
st.markdown(f'<meta http-equiv="refresh" content="0;URL={selected_app_url}">', unsafe_allow_html=True)
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
|
128 |
# Dropdown menu for other app links
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
st.sidebar.write("In case the apps are down, because of less usage")
|
131 |
st.sidebar.write("Kindly reach out to me @ [email protected]")
|