헤더 우측 액션 단순화
This commit is contained in:
@@ -6,7 +6,6 @@ const loginForm = document.getElementById("login-form");
|
|||||||
const loginMessage = document.getElementById("login-message");
|
const loginMessage = document.getElementById("login-message");
|
||||||
const logoutBtn = document.getElementById("logout-btn");
|
const logoutBtn = document.getElementById("logout-btn");
|
||||||
const userBadge = document.getElementById("user-badge");
|
const userBadge = document.getElementById("user-badge");
|
||||||
const healthStatus = document.getElementById("health-status");
|
|
||||||
|
|
||||||
function getSession() {
|
function getSession() {
|
||||||
try {
|
try {
|
||||||
@@ -30,22 +29,8 @@ function renderAuth() {
|
|||||||
loginPanel.classList.toggle("hidden", authenticated);
|
loginPanel.classList.toggle("hidden", authenticated);
|
||||||
dashboardPanel.classList.toggle("hidden", !authenticated);
|
dashboardPanel.classList.toggle("hidden", !authenticated);
|
||||||
if (authenticated) {
|
if (authenticated) {
|
||||||
userBadge.textContent = `${session.user.display_name} / ${session.user.role}`;
|
userBadge.textContent = "내 정보";
|
||||||
refreshHealth();
|
userBadge.title = `${session.user.display_name} / ${session.user.role}`;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function refreshHealth() {
|
|
||||||
if (!healthStatus) return;
|
|
||||||
healthStatus.textContent = "서버 상태 확인 중";
|
|
||||||
try {
|
|
||||||
const response = await fetch("/api/health");
|
|
||||||
if (!response.ok) throw new Error("unhealthy");
|
|
||||||
const payload = await response.json();
|
|
||||||
const count = typeof payload.member_count === "number" ? ` / ${payload.member_count}명` : "";
|
|
||||||
healthStatus.textContent = `API ${payload.status}${count}`;
|
|
||||||
} catch (error) {
|
|
||||||
healthStatus.textContent = "API 연결 실패";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<span id="health-status" class="status-badge">서버 상태 확인 중</span>
|
<button id="user-badge" class="ghost-button ghost-button-soft" type="button"></button>
|
||||||
<span id="user-badge" class="user-badge"></span>
|
|
||||||
<button id="logout-btn" class="ghost-button" type="button">로그아웃</button>
|
<button id="logout-btn" class="ghost-button" type="button">로그아웃</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -211,30 +211,7 @@
|
|||||||
.header-actions {
|
.header-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
}
|
|
||||||
|
|
||||||
.status-badge,
|
|
||||||
.user-badge {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 34px;
|
|
||||||
padding: 0 12px;
|
|
||||||
border-radius: 999px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-badge {
|
|
||||||
background: #eef2ff;
|
|
||||||
color: var(--color-accent-strong);
|
|
||||||
border: 1px solid #dfe5ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-badge {
|
|
||||||
background: #f8fafc;
|
|
||||||
color: var(--color-text);
|
|
||||||
border: 1px solid #dbe2ea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ghost-button {
|
.ghost-button {
|
||||||
@@ -242,12 +219,16 @@
|
|||||||
border: 1px solid #dbe2ea;
|
border: 1px solid #dbe2ea;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
padding: 0 14px;
|
padding: 0 12px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ghost-button-soft {
|
||||||
|
background: #f8fafc;
|
||||||
|
}
|
||||||
|
|
||||||
.dashboard-main {
|
.dashboard-main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: calc(100vh - 68px);
|
min-height: calc(100vh - 68px);
|
||||||
|
|||||||
Reference in New Issue
Block a user