Spaces:
Sleeping
Sleeping
Sync app from GitHub Actions (feature/project-state-security-privacy-review)
Browse files- src/ui/login_page.py +4 -10
- src/ui/theme.py +14 -17
src/ui/login_page.py
CHANGED
|
@@ -99,7 +99,6 @@ def create_login_page(
|
|
| 99 |
visible=False,
|
| 100 |
)
|
| 101 |
|
| 102 |
-
oauth_enter_button = None
|
| 103 |
username_input = None
|
| 104 |
login_button = None
|
| 105 |
if enable_oauth_login:
|
|
@@ -110,17 +109,12 @@ def create_login_page(
|
|
| 110 |
else "Secure login with your Hugging Face account to access your validation workspace."
|
| 111 |
)
|
| 112 |
)
|
| 113 |
-
gr.LoginButton(
|
| 114 |
"Sign in with Hugging Face",
|
| 115 |
logout_value="Sign out ({})",
|
| 116 |
icon=None,
|
| 117 |
elem_classes=["bn-oauth-login-button"],
|
| 118 |
)
|
| 119 |
-
oauth_enter_button = gr.Button(
|
| 120 |
-
"Enter workspace",
|
| 121 |
-
variant="primary",
|
| 122 |
-
elem_classes=["bn-login-workspace-button"],
|
| 123 |
-
)
|
| 124 |
elif allow_username_login:
|
| 125 |
gr.Markdown("Local development login")
|
| 126 |
username_input = gr.Textbox(
|
|
@@ -139,13 +133,13 @@ def create_login_page(
|
|
| 139 |
) -> Tuple[str, str]:
|
| 140 |
return perform_oauth_login(auth_service, profile, oauth_token)
|
| 141 |
|
| 142 |
-
if
|
| 143 |
-
|
| 144 |
fn=handle_oauth_login,
|
| 145 |
inputs=None,
|
| 146 |
outputs=[session_output, error_message],
|
| 147 |
)
|
| 148 |
-
|
| 149 |
login_button.click(
|
| 150 |
fn=lambda username: perform_login(
|
| 151 |
auth_service,
|
|
|
|
| 99 |
visible=False,
|
| 100 |
)
|
| 101 |
|
|
|
|
| 102 |
username_input = None
|
| 103 |
login_button = None
|
| 104 |
if enable_oauth_login:
|
|
|
|
| 109 |
else "Secure login with your Hugging Face account to access your validation workspace."
|
| 110 |
)
|
| 111 |
)
|
| 112 |
+
login_button = gr.LoginButton(
|
| 113 |
"Sign in with Hugging Face",
|
| 114 |
logout_value="Sign out ({})",
|
| 115 |
icon=None,
|
| 116 |
elem_classes=["bn-oauth-login-button"],
|
| 117 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
elif allow_username_login:
|
| 119 |
gr.Markdown("Local development login")
|
| 120 |
username_input = gr.Textbox(
|
|
|
|
| 133 |
) -> Tuple[str, str]:
|
| 134 |
return perform_oauth_login(auth_service, profile, oauth_token)
|
| 135 |
|
| 136 |
+
if enable_oauth_login and login_button is not None:
|
| 137 |
+
login_button.click(
|
| 138 |
fn=handle_oauth_login,
|
| 139 |
inputs=None,
|
| 140 |
outputs=[session_output, error_message],
|
| 141 |
)
|
| 142 |
+
elif login_button is not None and username_input is not None:
|
| 143 |
login_button.click(
|
| 144 |
fn=lambda username: perform_login(
|
| 145 |
auth_service,
|
src/ui/theme.py
CHANGED
|
@@ -159,22 +159,6 @@ button.bn-oauth-login-button * {
|
|
| 159 |
white-space: nowrap !important;
|
| 160 |
}
|
| 161 |
|
| 162 |
-
.bn-login-workspace-button button,
|
| 163 |
-
button.bn-login-workspace-button {
|
| 164 |
-
min-height: 48px !important;
|
| 165 |
-
border: 1px solid #93c5fd !important;
|
| 166 |
-
border-radius: 8px !important;
|
| 167 |
-
background: #dbeafe !important;
|
| 168 |
-
color: #075985 !important;
|
| 169 |
-
font-weight: 780 !important;
|
| 170 |
-
}
|
| 171 |
-
|
| 172 |
-
.bn-login-workspace-button button:hover,
|
| 173 |
-
button.bn-login-workspace-button:hover {
|
| 174 |
-
border-color: #60a5fa !important;
|
| 175 |
-
background: #bfdbfe !important;
|
| 176 |
-
}
|
| 177 |
-
|
| 178 |
.bn-panel {
|
| 179 |
background: var(--bn-panel);
|
| 180 |
border: 1px solid var(--bn-border);
|
|
@@ -337,7 +321,7 @@ button.bn-login-workspace-button:hover {
|
|
| 337 |
.bn-clean-slider .form,
|
| 338 |
.bn-clean-slider .styler,
|
| 339 |
.bn-clean-slider > div {
|
| 340 |
-
background:
|
| 341 |
}
|
| 342 |
|
| 343 |
.bn-clean-slider input,
|
|
@@ -345,6 +329,19 @@ button.bn-login-workspace-button:hover {
|
|
| 345 |
background: #ffffff !important;
|
| 346 |
}
|
| 347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
.bn-danger-zone {
|
| 349 |
border-color: #f3b6b2 !important;
|
| 350 |
background: #fffafa !important;
|
|
|
|
| 159 |
white-space: nowrap !important;
|
| 160 |
}
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
.bn-panel {
|
| 163 |
background: var(--bn-panel);
|
| 164 |
border: 1px solid var(--bn-border);
|
|
|
|
| 321 |
.bn-clean-slider .form,
|
| 322 |
.bn-clean-slider .styler,
|
| 323 |
.bn-clean-slider > div {
|
| 324 |
+
background: #ffffff !important;
|
| 325 |
}
|
| 326 |
|
| 327 |
.bn-clean-slider input,
|
|
|
|
| 329 |
background: #ffffff !important;
|
| 330 |
}
|
| 331 |
|
| 332 |
+
.bn-sidebar-panel .block,
|
| 333 |
+
.bn-sidebar-panel .form,
|
| 334 |
+
.bn-sidebar-panel .styler,
|
| 335 |
+
.bn-sidebar-panel .wrap,
|
| 336 |
+
.bn-sidebar-panel .contain,
|
| 337 |
+
.bn-sidebar-panel .gradio-slider,
|
| 338 |
+
.bn-sidebar-panel .gradio-slider > div,
|
| 339 |
+
.bn-sidebar-panel .gradio-slider label,
|
| 340 |
+
.bn-sidebar-panel .gradio-slider input,
|
| 341 |
+
.bn-sidebar-panel .gradio-slider [data-testid="number-input"] {
|
| 342 |
+
background: #ffffff !important;
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
.bn-danger-zone {
|
| 346 |
border-color: #f3b6b2 !important;
|
| 347 |
background: #fffafa !important;
|