Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1 |
import streamlit as st
|
2 |
-
from state import provide_state
|
3 |
-
import json
|
4 |
|
5 |
-
INITIAL_CONF = {
|
6 |
-
"checkbox": False,
|
7 |
-
"number": 0.0
|
8 |
-
}
|
9 |
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
12 |
query_params = st.experimental_get_query_params()
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
state.conf["checkbox"] = st.checkbox("Retain State !", value=state.conf["checkbox"])
|
18 |
-
state.conf["number"] = st.number_input("You Too Retain State !", value=state.conf["number"])
|
19 |
-
st.experimental_set_query_params(**{"conf": json.dumps(state.conf)})
|
20 |
|
21 |
-
|
|
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
def show_main_settings():
|
5 |
+
st.write(f'Hi {st.session_state.query_params}')
|
6 |
+
|
7 |
+
|
8 |
+
def run_dash():
|
9 |
query_params = st.experimental_get_query_params()
|
10 |
+
st.session_state.query_params = query_params
|
11 |
+
|
12 |
+
if 'id' in query_params:
|
13 |
+
show_main_settings()
|
14 |
+
else:
|
15 |
+
st.write('Malformed URL, missing id.')
|
16 |
+
st.write(query_params)
|
17 |
|
|
|
|
|
|
|
18 |
|
19 |
+
if __name__ == '__main__':
|
20 |
+
run_dash()
|