From 07094d93529c7c635641cefc00feb892a95c9290 Mon Sep 17 00:00:00 2001 From: Hyemin Lee Date: Fri, 10 Jul 2026 10:03:45 +0900 Subject: [PATCH] =?UTF-8?q?feat(demo):=20expose=20demo=5Fmode=20to=20templ?= =?UTF-8?q?ates=20+=20=EC=97=B0=EA=B2=B0=20=EB=B0=B0=EC=A7=80=20=EB=8D=B0?= =?UTF-8?q?=EB=AA=A8=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - deps.py: PULP_DEMO 설정을 Jinja 전역(demo_mode)으로 노출 → 모든 템플릿에서 참조 가능. 실연동 오인 방지(데모는 화면 확인 전용). - health.html: 데모 모드일 때 연결 배지를 "데모 모드 · 가짜 데이터" 칩으로 표시. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/deps.py | 3 +++ app/templates/partials/health.html | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/deps.py b/app/deps.py index 894f0ff..66c6671 100644 --- a/app/deps.py +++ b/app/deps.py @@ -15,6 +15,9 @@ from .pulp_client import PulpClient TEMPLATES_DIR = Path(__file__).resolve().parent / "templates" templates = Jinja2Templates(directory=str(TEMPLATES_DIR)) +# 데모(가짜 데이터) 모드를 모든 템플릿에서 참조 가능하게 전역 노출 → 배너/배지로 명시. +# 설정은 lru_cache 라 프로세스 내 상수. 실연동 오인 방지용(스펙: 데모는 화면 확인 전용). +templates.env.globals["demo_mode"] = get_settings().pulp_demo def get_pulp_client() -> Iterator[PulpClient]: diff --git a/app/templates/partials/health.html b/app/templates/partials/health.html index 6c367a1..3a6da1b 100644 --- a/app/templates/partials/health.html +++ b/app/templates/partials/health.html @@ -1,4 +1,6 @@ -{% if online %} +{% if demo_mode %} +데모 모드 · 가짜 데이터 +{% elif online %} {{ detail }} {% else %} {{ detail }}