Initial dashboard organization setup
This commit is contained in:
4
frontend/Dockerfile
Executable file
4
frontend/Dockerfile
Executable file
@@ -0,0 +1,4 @@
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY frontend/public /usr/share/nginx/html
|
||||
|
||||
85
frontend/public/app.js
Executable file
85
frontend/public/app.js
Executable file
@@ -0,0 +1,85 @@
|
||||
const sessionKey = "mh-dashboard-session";
|
||||
|
||||
const loginPanel = document.getElementById("login-panel");
|
||||
const dashboardPanel = document.getElementById("dashboard-panel");
|
||||
const loginForm = document.getElementById("login-form");
|
||||
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 {
|
||||
return JSON.parse(sessionStorage.getItem(sessionKey) || "null");
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function setSession(session) {
|
||||
sessionStorage.setItem(sessionKey, JSON.stringify(session));
|
||||
}
|
||||
|
||||
function clearSession() {
|
||||
sessionStorage.removeItem(sessionKey);
|
||||
}
|
||||
|
||||
function renderAuth() {
|
||||
const session = getSession();
|
||||
const authenticated = Boolean(session?.user?.display_name);
|
||||
loginPanel.classList.toggle("hidden", authenticated);
|
||||
dashboardPanel.classList.toggle("hidden", !authenticated);
|
||||
if (authenticated) {
|
||||
userBadge.textContent = `${session.user.display_name} / ${session.user.role}`;
|
||||
refreshHealth();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
healthStatus.textContent = `API 상태: ${payload.status}`;
|
||||
} catch (error) {
|
||||
healthStatus.textContent = "API에 연결할 수 없습니다. backend 컨테이너를 확인해주세요.";
|
||||
}
|
||||
}
|
||||
|
||||
if (loginForm) {
|
||||
loginForm.addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
loginMessage.textContent = "로그인 처리 중입니다.";
|
||||
const formData = new FormData(loginForm);
|
||||
try {
|
||||
const response = await fetch("/api/mock-login", {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
const payload = await response.json();
|
||||
if (!response.ok) throw new Error(payload.detail || "login failed");
|
||||
setSession(payload);
|
||||
loginForm.reset();
|
||||
renderAuth();
|
||||
} catch (error) {
|
||||
loginMessage.textContent = "로그인에 실패했습니다. backend 연결 상태를 확인해주세요.";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (logoutBtn) {
|
||||
logoutBtn.addEventListener("click", () => {
|
||||
clearSession();
|
||||
renderAuth();
|
||||
});
|
||||
}
|
||||
|
||||
if (refreshHealthBtn) {
|
||||
refreshHealthBtn.addEventListener("click", refreshHealth);
|
||||
}
|
||||
|
||||
renderAuth();
|
||||
|
||||
79
frontend/public/index.html
Executable file
79
frontend/public/index.html
Executable file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MH Dashboard Hub</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=SUIT:wght@400;500;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-shell">
|
||||
<section class="panel hero" id="login-panel">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Intranet Preview</p>
|
||||
<h1>MH Dashboard Hub</h1>
|
||||
<p class="hero-text">
|
||||
현재 단계에서는 화면상 로그인만 우선 적용합니다. 로그인 후 조직도 레거시 화면과
|
||||
서버 준비 상태를 한 곳에서 확인할 수 있습니다.
|
||||
</p>
|
||||
</div>
|
||||
<form id="login-form" class="login-card">
|
||||
<label>
|
||||
<span>아이디</span>
|
||||
<input name="username" type="text" placeholder="예: admin" required>
|
||||
</label>
|
||||
<label>
|
||||
<span>비밀번호</span>
|
||||
<input name="password" type="password" placeholder="아무 값이나 입력" required>
|
||||
</label>
|
||||
<button type="submit">대시보드 입장</button>
|
||||
<p id="login-message" class="helper-text">사내망용 임시 로그인 화면입니다.</p>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section id="dashboard-panel" class="hidden">
|
||||
<header class="topbar">
|
||||
<div>
|
||||
<p class="eyebrow">Internal Dashboard</p>
|
||||
<h2>조직 관리 허브</h2>
|
||||
</div>
|
||||
<div class="topbar-actions">
|
||||
<span id="user-badge" class="badge"></span>
|
||||
<button id="logout-btn" class="secondary">로그아웃</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="grid">
|
||||
<article class="panel card">
|
||||
<p class="eyebrow">Legacy Module</p>
|
||||
<h3>조직도 관리</h3>
|
||||
<p>기존 단일 HTML 조직도 도구를 보존한 상태로 연결했습니다.</p>
|
||||
<a class="primary-link" href="/organization.html">레거시 조직도 열기</a>
|
||||
</article>
|
||||
|
||||
<article class="panel card">
|
||||
<p class="eyebrow">API Readiness</p>
|
||||
<h3>서버 상태</h3>
|
||||
<p id="health-status">서버 상태를 확인하는 중입니다.</p>
|
||||
<button id="refresh-health-btn" class="secondary">상태 새로고침</button>
|
||||
</article>
|
||||
|
||||
<article class="panel card">
|
||||
<p class="eyebrow">Roadmap</p>
|
||||
<h3>다음 단계</h3>
|
||||
<ul class="roadmap">
|
||||
<li>프로필 사진 업로드 API 연결</li>
|
||||
<li>좌석 배치도 좌표 저장 기능 연결</li>
|
||||
<li>월말 스냅샷 자동화</li>
|
||||
</ul>
|
||||
</article>
|
||||
</main>
|
||||
</section>
|
||||
</div>
|
||||
<script src="/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
25
frontend/public/organization.html
Executable file
25
frontend/public/organization.html
Executable file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>조직도 관리</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=SUIT:wght@400;500;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/styles.css">
|
||||
</head>
|
||||
<body class="subpage-body">
|
||||
<header class="topbar compact">
|
||||
<div>
|
||||
<p class="eyebrow">Legacy Bridge</p>
|
||||
<h2>조직도 레거시 화면</h2>
|
||||
</div>
|
||||
<a class="secondary anchor-button" href="/">허브로 돌아가기</a>
|
||||
</header>
|
||||
<main class="iframe-wrap">
|
||||
<iframe src="/legacy/organization" title="조직도 레거시 앱"></iframe>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
210
frontend/public/styles.css
Executable file
210
frontend/public/styles.css
Executable file
@@ -0,0 +1,210 @@
|
||||
:root {
|
||||
--bg: #eef4f1;
|
||||
--panel: rgba(255, 255, 255, 0.86);
|
||||
--line: rgba(15, 23, 42, 0.08);
|
||||
--text: #173028;
|
||||
--muted: #5f746d;
|
||||
--accent: #0f766e;
|
||||
--accent-soft: #d7f3ee;
|
||||
--shadow: 0 24px 60px rgba(14, 48, 41, 0.12);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "SUIT", sans-serif;
|
||||
color: var(--text);
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(15, 118, 110, 0.22), transparent 28%),
|
||||
radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.18), transparent 24%),
|
||||
linear-gradient(135deg, #f5fbf7 0%, #e9f0fb 100%);
|
||||
}
|
||||
|
||||
.app-shell {
|
||||
max-width: 1240px;
|
||||
margin: 0 auto;
|
||||
padding: 48px 20px 56px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 28px;
|
||||
box-shadow: var(--shadow);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.hero {
|
||||
display: grid;
|
||||
gap: 28px;
|
||||
grid-template-columns: 1.2fr 0.8fr;
|
||||
padding: 36px;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 10px;
|
||||
color: var(--accent);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.hero h1,
|
||||
.topbar h2,
|
||||
.card h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: clamp(2.3rem, 5vw, 4.5rem);
|
||||
line-height: 0.95;
|
||||
}
|
||||
|
||||
.hero-text,
|
||||
.card p,
|
||||
.helper-text,
|
||||
.roadmap {
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
padding: 24px;
|
||||
border-radius: 24px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border: 1px solid rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.login-card label,
|
||||
.topbar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
.anchor-button,
|
||||
.primary-link {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 1px solid rgba(15, 23, 42, 0.12);
|
||||
border-radius: 14px;
|
||||
padding: 14px 16px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
button,
|
||||
.primary-link,
|
||||
.anchor-button {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-height: 48px;
|
||||
border-radius: 14px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-weight: 800;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button,
|
||||
.primary-link {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.secondary,
|
||||
.anchor-button {
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.topbar.compact {
|
||||
max-width: 1240px;
|
||||
margin: 0 auto;
|
||||
padding: 28px 20px 0;
|
||||
}
|
||||
|
||||
.topbar-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
padding: 10px 14px;
|
||||
border-radius: 999px;
|
||||
background: rgba(15, 118, 110, 0.12);
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.roadmap {
|
||||
padding-left: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.iframe-wrap {
|
||||
max-width: 1240px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.iframe-wrap iframe {
|
||||
width: 100%;
|
||||
min-height: calc(100vh - 130px);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 24px;
|
||||
background: #fff;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.subpage-body {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 920px) {
|
||||
.hero,
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.topbar,
|
||||
.topbar-actions {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user