Files
dbx-main/app/modules/cafe24/templates/cafe24/system.html
T
king 4286c45531 feat(카페24): 상품 목록 대표 이미지 열, 상단 탭 여백 10px
- 목록 번호와 상품명 사이에 64x64 대표 이미지 표시(tiny_image, 없으면 detail_image)
- 대표 이미지 교체 시 목록 썸네일도 즉시 갱신
- 상단 탭 위아래 여백 10px 고정
- 이미지 열만큼 목록 폭 72px 확대

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:46:48 +09:00

138 lines
5.4 KiB
HTML

{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/cafe24.css?v=20261110a" />
{% endblock %}
{% block content %}
{% include "cafe24/_nav.html" %}
{% if flash %}<div class="cf24-flash cf24-flash-ok">{{ flash }}</div>{% endif %}
{% if flash_error %}<div class="cf24-flash cf24-flash-err">{{ flash_error }}</div>{% endif %}
{# ── 연결 상태 ───────────────────────────────────────────── #}
<div class="erp-card cf24-card">
<div class="cf24-card-head">
<h3>카페24 연결</h3>
{% if status.connected %}
<span class="erp-badge cf24-badge-ok">연결됨</span>
{% else %}
<span class="erp-badge cf24-badge-off">연결 안 됨</span>
{% endif %}
</div>
{% if status.missing %}
<div class="cf24-flash cf24-flash-err">
다음 환경변수가 설정되지 않았습니다:
<code>{{ status.missing | join(', ') }}</code><br />
<code>.env</code> 에 추가한 뒤 컨테이너를 재기동하세요.
</div>
{% endif %}
{% if status.reason %}<p class="cf24-muted">{{ status.reason }}</p>{% endif %}
<table class="erp-table cf24-kv">
<tbody>
<tr><th>쇼핑몰 ID</th><td>{{ status.mall_id or '—' }}</td></tr>
<tr><th>API 버전</th><td>{{ api_version }}</td></tr>
<tr><th>요청 권한(scope)</th><td><code>{{ scopes }}</code></td></tr>
<tr><th>Redirect URI</th><td><code>{{ redirect_uri or '—' }}</code></td></tr>
<tr>
<th>승인된 권한</th>
<td>{% if status.scopes %}<code>{{ status.scopes }}</code>{% else %}—{% endif %}</td>
</tr>
<tr>
<th>Access Token 만료</th>
<td>
{{ status.access_token_expires_at or '—' }}
{% if status.access_expired %}<span class="cf24-muted">(만료 — 다음 호출 시 자동 갱신)</span>{% endif %}
</td>
</tr>
<tr><th>Refresh Token 만료</th><td>{{ status.refresh_token_expires_at or '—' }}</td></tr>
<tr><th>마지막 갱신</th><td>{{ status.last_refreshed_at or '—' }}</td></tr>
<tr><th>연결한 사람</th><td>{{ status.connected_by or '—' }}</td></tr>
{% if status.last_error %}
<tr><th>마지막 오류</th><td class="cf24-err">{{ status.last_error }}</td></tr>
{% endif %}
</tbody>
</table>
{% if is_admin %}
<div class="cf24-actions">
<a class="erp-btn erp-btn-primary" href="/cafe24/system/oauth/start">
{% if status.connected %}카페24 재연결{% else %}카페24 연결{% endif %}
</a>
{% if status.connected or status.needs_reauth %}
<form method="post" action="/cafe24/system/oauth/disconnect" style="display:inline;"
data-erp-confirm="저장된 카페24 토큰을 삭제합니다. 계속할까요?&#10;(변경 이력·예약 데이터는 지워지지 않습니다)">
<button type="submit" class="erp-btn erp-btn-outline">연결 해제</button>
</form>
{% endif %}
</div>
{% else %}
<p class="cf24-muted">카페24 연결 변경은 관리자만 할 수 있습니다.</p>
{% endif %}
</div>
{# ── 작업 로그 ───────────────────────────────────────────── #}
<div class="erp-card cf24-card">
<div class="cf24-card-head"><h3>작업 로그</h3><span class="cf24-muted">최근 50건</span></div>
{% if audit_logs %}
<div class="cf24-scroll">
<table class="erp-table">
<thead>
<tr><th>시각</th><th>작업자</th><th>작업</th><th>상품</th><th>결과</th><th>내용</th></tr>
</thead>
<tbody>
{% for log in audit_logs %}
<tr>
<td class="cf24-nowrap">{{ log.created_at }}</td>
<td>{{ log.actor or '—' }}</td>
<td>{{ log.action }}</td>
<td>{{ log.product_no or '—' }}</td>
<td class="{% if log.result == 'FAIL' %}cf24-err{% endif %}">{{ log.result or '—' }}</td>
<td>{{ log.detail or '' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="cf24-muted">아직 기록된 작업이 없습니다.</p>
{% endif %}
</div>
{# ── API 로그 ────────────────────────────────────────────── #}
<div class="erp-card cf24-card">
<div class="cf24-card-head">
<h3>카페24 API 로그</h3>
<span class="cf24-muted">최근 50건 · 토큰/시크릿은 기록하지 않습니다</span>
</div>
{% if api_logs %}
<div class="cf24-scroll">
<table class="erp-table">
<thead>
<tr><th>시각</th><th>메서드</th><th>엔드포인트</th><th>상품</th><th>상태</th><th>결과</th><th>소요</th><th>오류</th></tr>
</thead>
<tbody>
{% for log in api_logs %}
<tr>
<td class="cf24-nowrap">{{ log.created_at }}</td>
<td>{{ log.method }}</td>
<td><code>{{ log.endpoint }}</code></td>
<td>{{ log.product_no or '—' }}</td>
<td>{{ log.http_status or '—' }}</td>
<td class="{% if log.result != 'SUCCESS' %}cf24-err{% endif %}">{{ log.result }}</td>
<td class="cf24-nowrap">{{ log.duration_ms }}ms</td>
<td>{{ log.error_message or '' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="cf24-muted">아직 API 호출 기록이 없습니다.</p>
{% endif %}
</div>
{% endblock %}