feat(demo): expose demo_mode to templates + 연결 배지 데모 표시

- deps.py: PULP_DEMO 설정을 Jinja 전역(demo_mode)으로 노출 → 모든
  템플릿에서 참조 가능. 실연동 오인 방지(데모는 화면 확인 전용).
- health.html: 데모 모드일 때 연결 배지를 "데모 모드 · 가짜 데이터"
  칩으로 표시.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 10:03:45 +09:00
parent c43d18ceea
commit 07094d9352
2 changed files with 6 additions and 1 deletions

View File

@@ -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]: