TK-FB(공장관리+신고)와 M-Project(부적합관리)를 3개 독립 시스템으로 분리하기 위한 전체 코드 구조 작성. - SSO 인증 서비스 (bcrypt + pbkdf2 이중 해시 지원) - System 1: 공장관리 (TK-FB 기반, 신고 코드 제거) - System 2: 신고 (TK-FB에서 workIssue 코드 추출) - System 3: 부적합관리 (M-Project 기반) - Gateway 포털 (path-based 라우팅) - 통합 docker-compose.yml 및 배포 스크립트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
212 lines
7.7 KiB
HTML
212 lines
7.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>TK 공장관리 시스템</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
background: #f0f2f5;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.header {
|
|
background: #1a56db;
|
|
color: white;
|
|
padding: 16px 24px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
.header h1 { font-size: 20px; font-weight: 600; }
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
font-size: 14px;
|
|
}
|
|
.user-info span { opacity: 0.9; }
|
|
.btn-logout {
|
|
background: rgba(255,255,255,0.2);
|
|
color: white;
|
|
border: none;
|
|
padding: 6px 14px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 13px;
|
|
}
|
|
.btn-logout:hover { background: rgba(255,255,255,0.3); }
|
|
.container {
|
|
max-width: 900px;
|
|
margin: 40px auto;
|
|
padding: 0 20px;
|
|
flex: 1;
|
|
}
|
|
.welcome {
|
|
text-align: center;
|
|
margin-bottom: 36px;
|
|
}
|
|
.welcome h2 { font-size: 26px; color: #1f2937; margin-bottom: 8px; }
|
|
.welcome p { color: #6b7280; font-size: 15px; }
|
|
.systems {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
.system-card {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 28px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
border: 2px solid transparent;
|
|
}
|
|
.system-card:hover {
|
|
transform: translateY(-4px);
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.12);
|
|
}
|
|
.system-card.s1 { border-top: 4px solid #1a56db; }
|
|
.system-card.s2 { border-top: 4px solid #dc2626; }
|
|
.system-card.s3 { border-top: 4px solid #059669; }
|
|
.system-icon { font-size: 36px; margin-bottom: 14px; }
|
|
.system-card h3 { font-size: 18px; color: #1f2937; margin-bottom: 6px; }
|
|
.system-card p { color: #6b7280; font-size: 13px; line-height: 1.5; }
|
|
.system-card .badge {
|
|
display: inline-block;
|
|
margin-top: 12px;
|
|
padding: 3px 10px;
|
|
border-radius: 12px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
}
|
|
.s1 .badge { background: #dbeafe; color: #1d4ed8; }
|
|
.s2 .badge { background: #fee2e2; color: #dc2626; }
|
|
.s3 .badge { background: #d1fae5; color: #059669; }
|
|
.footer {
|
|
text-align: center;
|
|
padding: 20px;
|
|
color: #9ca3af;
|
|
font-size: 12px;
|
|
}
|
|
.login-prompt {
|
|
text-align: center;
|
|
padding: 60px 20px;
|
|
}
|
|
.login-prompt h2 { margin-bottom: 16px; color: #1f2937; }
|
|
.btn-login {
|
|
display: inline-block;
|
|
background: #1a56db;
|
|
color: white;
|
|
padding: 12px 32px;
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
font-size: 15px;
|
|
font-weight: 500;
|
|
}
|
|
.btn-login:hover { background: #1e40af; }
|
|
.no-access {
|
|
opacity: 0.5;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<h1>TK 공장관리 시스템</h1>
|
|
<div class="user-info" id="userInfo" style="display:none">
|
|
<span id="userName"></span>
|
|
<span id="userRole"></span>
|
|
<button class="btn-logout" onclick="logout()">로그아웃</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<!-- 로그인 전 -->
|
|
<div class="login-prompt" id="loginPrompt">
|
|
<h2>시스템에 접속하려면 로그인하세요</h2>
|
|
<a href="/login" class="btn-login">로그인</a>
|
|
</div>
|
|
|
|
<!-- 로그인 후 -->
|
|
<div id="dashboard" style="display:none">
|
|
<div class="welcome">
|
|
<h2 id="welcomeText">환영합니다</h2>
|
|
<p>사용할 시스템을 선택하세요</p>
|
|
</div>
|
|
<div class="systems">
|
|
<a href="/factory/" class="system-card s1" id="card-s1">
|
|
<div class="system-icon">🏭</div>
|
|
<h3>공장관리</h3>
|
|
<p>작업보고, 근태관리, TBM, 순회점검, 장비관리 등 현장 운영 전반</p>
|
|
<span class="badge">System 1</span>
|
|
</a>
|
|
<a href="/report/" class="system-card s2" id="card-s2">
|
|
<div class="system-icon">🚨</div>
|
|
<h3>신고 시스템</h3>
|
|
<p>안전/부적합 이슈 신고, 처리현황 추적, 부적합 자동 연동</p>
|
|
<span class="badge">System 2</span>
|
|
</a>
|
|
<a href="/nc/" class="system-card s3" id="card-s3">
|
|
<div class="system-icon">📋</div>
|
|
<h3>부적합 관리</h3>
|
|
<p>부적합 이슈 접수, 처리, 리포트 생성, 프로젝트별 현황 관리</p>
|
|
<span class="badge">System 3</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">TK Factory Services v1.0</div>
|
|
|
|
<script src="/shared/nav-header.js"></script>
|
|
<script>
|
|
const TOKEN_KEY = 'sso_token';
|
|
const USER_KEY = 'sso_user';
|
|
|
|
function init() {
|
|
const token = localStorage.getItem(TOKEN_KEY);
|
|
const user = JSON.parse(localStorage.getItem(USER_KEY) || 'null');
|
|
|
|
if (token && user) {
|
|
showDashboard(user);
|
|
} else {
|
|
document.getElementById('loginPrompt').style.display = '';
|
|
document.getElementById('dashboard').style.display = 'none';
|
|
}
|
|
}
|
|
|
|
function showDashboard(user) {
|
|
document.getElementById('loginPrompt').style.display = 'none';
|
|
document.getElementById('dashboard').style.display = '';
|
|
document.getElementById('userInfo').style.display = 'flex';
|
|
document.getElementById('userName').textContent = user.name || user.username;
|
|
document.getElementById('userRole').textContent = '(' + (user.role || '') + ')';
|
|
document.getElementById('welcomeText').textContent =
|
|
(user.name || user.username) + '님, 환영합니다';
|
|
|
|
// 접근 권한에 따라 카드 비활성화
|
|
const access = user.system_access || {};
|
|
if (access.system1 === false) document.getElementById('card-s1').classList.add('no-access');
|
|
if (access.system2 === false) document.getElementById('card-s2').classList.add('no-access');
|
|
if (access.system3 === false) document.getElementById('card-s3').classList.add('no-access');
|
|
}
|
|
|
|
function logout() {
|
|
localStorage.removeItem(TOKEN_KEY);
|
|
localStorage.removeItem(USER_KEY);
|
|
fetch('/auth/logout', { method: 'POST' }).catch(() => {});
|
|
location.reload();
|
|
}
|
|
|
|
init();
|
|
</script>
|
|
</body>
|
|
</html>
|