조직도 중심 메인 화면 샘플 구성
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user