deploy: update habadashi_login
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ logging.getLogger("uvicorn.access").addFilter(_SuppressGet200Filter())
|
|
| 21 |
from pathlib import Path
|
| 22 |
from fastapi import FastAPI, Request, Depends, HTTPException
|
| 23 |
from fastapi.responses import RedirectResponse, JSONResponse
|
|
|
|
| 24 |
from starlette.middleware.base import BaseHTTPMiddleware
|
| 25 |
import gradio as gr
|
| 26 |
from supabase import create_client, Client
|
|
@@ -89,6 +90,11 @@ except Exception as e:
|
|
| 89 |
# --- FastAPI App ---
|
| 90 |
print("[PHASE] fastapi_init_start")
|
| 91 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
print("[PHASE] fastapi_init_end")
|
| 93 |
|
| 94 |
# user_id -> profile dict のキャッシュ(プロセス内で保持、ログイン情報は変わらない前提)
|
|
|
|
| 21 |
from pathlib import Path
|
| 22 |
from fastapi import FastAPI, Request, Depends, HTTPException
|
| 23 |
from fastapi.responses import RedirectResponse, JSONResponse
|
| 24 |
+
from fastapi.staticfiles import StaticFiles
|
| 25 |
from starlette.middleware.base import BaseHTTPMiddleware
|
| 26 |
import gradio as gr
|
| 27 |
from supabase import create_client, Client
|
|
|
|
| 90 |
# --- FastAPI App ---
|
| 91 |
print("[PHASE] fastapi_init_start")
|
| 92 |
app = FastAPI()
|
| 93 |
+
|
| 94 |
+
# /static で静的ファイルを配信(logo.png などのアセット用)
|
| 95 |
+
_static_dir = Path(__file__).parent
|
| 96 |
+
app.mount("/static", StaticFiles(directory=str(_static_dir)), name="static")
|
| 97 |
+
|
| 98 |
print("[PHASE] fastapi_init_end")
|
| 99 |
|
| 100 |
# user_id -> profile dict のキャッシュ(プロセス内で保持、ログイン情報は変わらない前提)
|
login.py
CHANGED
|
@@ -52,7 +52,7 @@ def create_login_ui(handle_login_fn):
|
|
| 52 |
with gr.Blocks(title="Login") as ui:
|
| 53 |
|
| 54 |
# --- 上段: ロゴ ---
|
| 55 |
-
gr.HTML('<img src="/
|
| 56 |
|
| 57 |
with gr.Column(visible=True) as login_form:
|
| 58 |
email_input = gr.Textbox(label="Email")
|
|
|
|
| 52 |
with gr.Blocks(title="Login") as ui:
|
| 53 |
|
| 54 |
# --- 上段: ロゴ ---
|
| 55 |
+
gr.HTML('<img src="/static/logo.png" alt="dlpo" style="height:48px;display:block;margin:16px 0 8px 0;">')
|
| 56 |
|
| 57 |
with gr.Column(visible=True) as login_form:
|
| 58 |
email_input = gr.Textbox(label="Email")
|