Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
add emoji;adjust UI
Browse files
app.py
CHANGED
|
@@ -892,26 +892,25 @@ with demo:
|
|
| 892 |
with gr.Row():
|
| 893 |
gr.DataFrame(get_data2, every=5, interactive=False)
|
| 894 |
#------------------------------------------------------------------------------
|
| 895 |
-
with gr.TabItem(" Discord Verification", elem_id="verify-tab", id=2):
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
login_button.click(check_login_wrapper, inputs=None, outputs=m1)
|
| 915 |
#------------------------------------------------------------------------------
|
| 916 |
with gr.TabItem("📈 Activity Heatmap", elem_id="activity-heatmap", id=1):
|
| 917 |
with gr.Row():
|
|
|
|
| 892 |
with gr.Row():
|
| 893 |
gr.DataFrame(get_data2, every=5, interactive=False)
|
| 894 |
#------------------------------------------------------------------------------
|
| 895 |
+
with gr.TabItem("✅ Discord Verification", elem_id="verify-tab", id=2):
|
| 896 |
+
login_button = gr.LoginButton()
|
| 897 |
+
m1 = gr.Markdown()
|
| 898 |
+
demo.load(verify_button, inputs=None, outputs=m1)
|
| 899 |
+
|
| 900 |
+
def check_login_status():
|
| 901 |
+
try:
|
| 902 |
+
return login_button.get_session().get("oauth_info", None)
|
| 903 |
+
except AttributeError:
|
| 904 |
+
return None
|
| 905 |
+
|
| 906 |
+
def check_login_wrapper():
|
| 907 |
+
session = check_login_status()
|
| 908 |
+
if session is None:
|
| 909 |
+
return "Not logged in."
|
| 910 |
+
else:
|
| 911 |
+
return f"Logged in as {session.get('username', 'Unknown')}"
|
| 912 |
+
|
| 913 |
+
login_button.click(check_login_wrapper, inputs=None, outputs=m1)
|
|
|
|
| 914 |
#------------------------------------------------------------------------------
|
| 915 |
with gr.TabItem("📈 Activity Heatmap", elem_id="activity-heatmap", id=1):
|
| 916 |
with gr.Row():
|