조직도 중심 메인 화면 샘플 구성

This commit is contained in:
hyunho
2026-03-25 10:50:28 +09:00
parent 3b4169d301
commit 00ca43e4cd
3 changed files with 394 additions and 231 deletions

View File

@@ -7,7 +7,6 @@ const loginMessage = document.getElementById("login-message");
const logoutBtn = document.getElementById("logout-btn");
const userBadge = document.getElementById("user-badge");
const healthStatus = document.getElementById("health-status");
const refreshHealthBtn = document.getElementById("refresh-health-btn");
function getSession() {
try {
@@ -38,14 +37,15 @@ function renderAuth() {
async function refreshHealth() {
if (!healthStatus) return;
healthStatus.textContent = "서버 상태 확인하는 중입니다.";
healthStatus.textContent = "서버 상태 확인";
try {
const response = await fetch("/api/health");
if (!response.ok) throw new Error("unhealthy");
const payload = await response.json();
healthStatus.textContent = `API 상태: ${payload.status}`;
const count = typeof payload.member_count === "number" ? ` / ${payload.member_count}` : "";
healthStatus.textContent = `API ${payload.status}${count}`;
} catch (error) {
healthStatus.textContent = "API 연결할 수 없습니다. backend 컨테이너를 확인해주세요.";
healthStatus.textContent = "API 연결 실패";
}
}
@@ -77,9 +77,4 @@ if (logoutBtn) {
});
}
if (refreshHealthBtn) {
refreshHealthBtn.addEventListener("click", refreshHealth);
}
renderAuth();