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:
@@ -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]:
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{% if online %}
|
||||
{% if demo_mode %}
|
||||
<span class="status-line status-demo">데모 모드 · 가짜 데이터</span>
|
||||
{% elif online %}
|
||||
<span class="status-line status-ok">{{ detail }}</span>
|
||||
{% else %}
|
||||
<span class="status-line status-bad">{{ detail }}</span>
|
||||
|
||||
Reference in New Issue
Block a user