Spaces:
Running
Running
Update ui.py
Browse files
ui.py
CHANGED
@@ -26,6 +26,50 @@ InitSession()
|
|
26 |
|
27 |
name, auth_status, username = authenticator.login('Login', 'main')
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def APP():
|
31 |
|
@@ -179,34 +223,5 @@ def APP():
|
|
179 |
|
180 |
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
0: ":material/login:",
|
185 |
-
1: ":material/personadd:",
|
186 |
-
|
187 |
-
}
|
188 |
-
|
189 |
-
selection = st.pills(
|
190 |
-
"ACCESS",
|
191 |
-
options=base_option_map.keys(),
|
192 |
-
format_func=lambda option: base_option_map[option],
|
193 |
-
selection_mode="single",
|
194 |
-
)
|
195 |
-
if selection==0:
|
196 |
-
|
197 |
-
|
198 |
-
if auth_status:
|
199 |
-
|
200 |
-
|
201 |
-
SHOWTABS()
|
202 |
-
|
203 |
-
elif auth_status==False:
|
204 |
-
st.write("login failed , try again")
|
205 |
-
|
206 |
-
if selection==1:
|
207 |
-
try:
|
208 |
-
if authenticator.register_user('Register'):
|
209 |
-
st.success("User registered successfully!")
|
210 |
-
except Exception as e:
|
211 |
-
st.error(e)
|
212 |
|
|
|
26 |
|
27 |
name, auth_status, username = authenticator.login('Login', 'main')
|
28 |
|
29 |
+
try:
|
30 |
+
registration_success = authenticator.register_user("Register", location="unrendered")
|
31 |
+
except Exception as e:
|
32 |
+
registration_success = False
|
33 |
+
st.error(f"Registration error: {e}")
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
base_option_map = {
|
41 |
+
|
42 |
+
0: ":material/login:",
|
43 |
+
1: ":material/personadd:",
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
selection = st.pills(
|
48 |
+
"ACCESS",
|
49 |
+
options=base_option_map.keys(),
|
50 |
+
format_func=lambda option: base_option_map[option],
|
51 |
+
selection_mode="single",
|
52 |
+
)
|
53 |
+
if selection==0:
|
54 |
+
|
55 |
+
|
56 |
+
if auth_status:
|
57 |
+
|
58 |
+
|
59 |
+
SHOWTABS()
|
60 |
+
|
61 |
+
elif auth_status==False:
|
62 |
+
st.write("login failed , try again")
|
63 |
+
|
64 |
+
if selection==1:
|
65 |
+
try:
|
66 |
+
if authenticator.register_user('Register'):
|
67 |
+
st.success("User registered successfully!")
|
68 |
+
except Exception as e:
|
69 |
+
st.error(e)
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
|
74 |
def APP():
|
75 |
|
|
|
223 |
|
224 |
|
225 |
|
226 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|