✨ 주요 변경사항: - 단일 docker-compose.yml로 통합 (로컬/시놀로지 환경 지원) - 시놀로지 볼륨 매핑 설정 (volume1: 이미지, volume3: 데이터) - 통합 배포 가이드 및 자동 배포 스크립트 추가 - 완전한 Memos 스타일 워크플로우 구현 🎯 새로운 기능: - 📝 메모 작성 (upload.html) - 이미지 업로드 지원 - 📥 수신함 (inbox.html) - 메모 편집 및 Todo/보드 변환 - ✅ Todo 목록 (todo-list.html) - 오늘 할 일 관리 - 📋 보드 (board.html) - 프로젝트 관리, 접기/펼치기, 이미지 지원 - 📚 아카이브 (archive.html) - 완료된 보드 보관 - 🔐 초기 설정 화면 - 관리자 계정 생성 🔧 기술적 개선: - 이미지 업로드/편집 완전 지원 - 반응형 디자인 및 모바일 최적화 - 보드 완료 후 자동 숨김 처리 - 메모 편집 시 제목 필드 제거 - 테스트 로그인 버튼 제거 (프로덕션 준비) - 과거 코드 정리 (TodoService, CalendarSyncService 등) 📦 배포 관련: - env.synology.example - 시놀로지 환경 설정 템플릿 - SYNOLOGY_DEPLOYMENT_GUIDE.md - 상세한 배포 가이드 - deploy-synology.sh - 원클릭 자동 배포 스크립트 - Nginx 정적 파일 서빙 및 이미지 프록시 설정 🗑️ 정리된 파일: - 사용하지 않는 HTML 페이지들 (dashboard, calendar, checklist 등) - 복잡한 통합 서비스들 (integrations 폴더) - 중복된 시놀로지 설정 파일들
511 lines
25 KiB
HTML
511 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Todo Project - 간결한 할일 관리</title>
|
|
|
|
<!-- PWA 설정 -->
|
|
<link rel="manifest" href="manifest.json">
|
|
<meta name="theme-color" content="#6366f1">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
|
<meta name="apple-mobile-web-app-title" content="Todo Project">
|
|
|
|
<!-- 파비콘 -->
|
|
<link rel="icon" href="favicon.ico" sizes="any">
|
|
<link rel="icon" href="static/icons/icon-192x192.png" type="image/png">
|
|
|
|
<!-- Apple Touch Icons -->
|
|
<link rel="apple-touch-icon" href="static/icons/apple-touch-icon.png">
|
|
<link rel="apple-touch-icon" sizes="167x167" href="static/icons/apple-touch-icon-ipad.png">
|
|
|
|
<!-- 추가 아이콘 크기들 -->
|
|
<link rel="icon" sizes="72x72" href="static/icons/icon-72x72.png">
|
|
<link rel="icon" sizes="96x96" href="static/icons/icon-96x96.png">
|
|
<link rel="icon" sizes="128x128" href="static/icons/icon-128x128.png">
|
|
<link rel="icon" sizes="144x144" href="static/icons/icon-144x144.png">
|
|
<link rel="icon" sizes="152x152" href="static/icons/icon-152x152.png">
|
|
<link rel="icon" sizes="192x192" href="static/icons/icon-192x192.png">
|
|
<link rel="icon" sizes="384x384" href="static/icons/icon-384x384.png">
|
|
<link rel="icon" sizes="512x512" href="static/icons/icon-512x512.png">
|
|
|
|
<!-- 외부 라이브러리 -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;500;600&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--parchment: #f7f3e9;
|
|
--parchment-dark: #f0ead6;
|
|
--ink: #2c1810;
|
|
--ink-light: #5d4e37;
|
|
--sepia: #8b7355;
|
|
--gold: #d4af37;
|
|
--shadow: rgba(139, 115, 85, 0.2);
|
|
--success: #10b981;
|
|
--danger: #ef4444;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Noto Serif KR', serif;
|
|
background: linear-gradient(to bottom, var(--parchment) 0%, #e0d8c7 100%);
|
|
color: var(--ink);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.parchment-container {
|
|
background-color: var(--parchment);
|
|
border: 1px solid var(--sepia);
|
|
box-shadow: 3px 3px 8px var(--shadow);
|
|
position: relative;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.parchment-container::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: -3px; left: -3px; right: -3px; bottom: -3px;
|
|
border: 1px dashed var(--gold);
|
|
z-index: -1;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--gold);
|
|
color: var(--ink);
|
|
border: 1px solid var(--gold);
|
|
transition: all 0.2s;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background-color: var(--sepia);
|
|
border-color: var(--sepia);
|
|
color: white;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px var(--shadow);
|
|
}
|
|
|
|
.input-field {
|
|
border: 1px solid var(--sepia);
|
|
background: white;
|
|
transition: all 0.2s;
|
|
color: var(--ink);
|
|
}
|
|
|
|
.input-field:focus {
|
|
border-color: var(--gold);
|
|
outline: none;
|
|
box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
|
|
}
|
|
|
|
.login-header {
|
|
background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
|
|
border-bottom: 3px solid var(--gold);
|
|
box-shadow: 0 2px 10px var(--shadow);
|
|
}
|
|
|
|
.todo-item {
|
|
background: white;
|
|
border-radius: 0.75rem;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.todo-item:hover {
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.status-draft { color: #6b7280; }
|
|
.status-scheduled { color: var(--primary); }
|
|
.status-active { color: var(--warning); }
|
|
.status-completed { color: var(--success); }
|
|
.status-delayed { color: var(--danger); }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- 로그인 화면 -->
|
|
<div id="loginScreen" class="min-h-screen flex items-center justify-center p-4">
|
|
<div class="parchment-container p-8 w-full max-w-md">
|
|
<div class="text-center mb-8">
|
|
<i class="fas fa-feather-alt text-5xl mb-4" style="color: var(--gold);"></i>
|
|
<h1 class="text-3xl font-semibold mb-2" style="color: var(--ink);">Todo Project</h1>
|
|
<p class="text-sm" style="color: var(--ink-light);">메모 중심의 간결한 할일 관리</p>
|
|
</div>
|
|
|
|
<form id="loginForm" class="space-y-5">
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">사용자명</label>
|
|
<input type="text" id="username" class="input-field w-full px-4 py-3 rounded-lg" placeholder="사용자명을 입력하세요" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">비밀번호</label>
|
|
<input type="password" id="password" class="input-field w-full px-4 py-3 rounded-lg" placeholder="비밀번호를 입력하세요" required>
|
|
</div>
|
|
|
|
<button type="submit" class="btn-primary w-full py-3 px-4 rounded-lg font-medium text-lg">
|
|
<i class="fas fa-sign-in-alt mr-2"></i>로그인
|
|
</button>
|
|
</form>
|
|
|
|
|
|
<!-- 이미 로그인된 상태 표시 -->
|
|
<div id="alreadyLoggedIn" class="mt-6 p-4 rounded-lg hidden" style="background-color: #f0fdf4; border: 1px solid #bbf7d0;">
|
|
<div class="text-center">
|
|
<i class="fas fa-check-circle text-xl mb-3" style="color: var(--success);"></i>
|
|
<p class="font-medium mb-3" style="color: #166534;">이미 로그인되어 있습니다!</p>
|
|
<button onclick="window.location.href='upload.html'"
|
|
class="w-full py-2 px-4 rounded-lg font-medium transition-all"
|
|
style="background-color: var(--success); color: white; border: 1px solid var(--success);"
|
|
onmouseover="this.style.backgroundColor='#059669'"
|
|
onmouseout="this.style.backgroundColor='var(--success)'">
|
|
<i class="fas fa-feather-alt mr-2"></i>메모 작성하기
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 초기 설정 화면 -->
|
|
<div id="setupScreen" class="hidden min-h-screen flex items-center justify-center p-4">
|
|
<div class="parchment-container p-8 w-full max-w-lg">
|
|
<div class="text-center mb-8">
|
|
<i class="fas fa-cog text-5xl mb-4" style="color: var(--gold);"></i>
|
|
<h1 class="text-3xl font-semibold mb-2" style="color: var(--ink);">시스템 초기 설정</h1>
|
|
<p class="text-sm" style="color: var(--ink-light);">관리자 계정을 설정하여 Todo Project를 시작하세요</p>
|
|
</div>
|
|
|
|
<form id="setupForm" class="space-y-5">
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">관리자 사용자명</label>
|
|
<input type="text" id="setupUsername" class="input-field w-full px-4 py-3 rounded-lg"
|
|
placeholder="관리자 사용자명 (3자 이상)" required minlength="3">
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">관리자 이메일</label>
|
|
<input type="email" id="setupEmail" class="input-field w-full px-4 py-3 rounded-lg"
|
|
placeholder="admin@example.com" required>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">관리자 비밀번호</label>
|
|
<input type="password" id="setupPassword" class="input-field w-full px-4 py-3 rounded-lg"
|
|
placeholder="비밀번호 (6자 이상)" required minlength="6">
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium mb-2" style="color: var(--ink-light);">관리자 이름</label>
|
|
<input type="text" id="setupFullName" class="input-field w-full px-4 py-3 rounded-lg"
|
|
placeholder="Administrator" value="Administrator">
|
|
</div>
|
|
|
|
<button type="submit" class="btn-primary w-full py-3 px-4 rounded-lg font-medium text-lg">
|
|
<i class="fas fa-rocket mr-2"></i>시스템 초기화
|
|
</button>
|
|
</form>
|
|
|
|
<div class="mt-6 p-4 rounded-lg" style="background-color: #fef3c7; border: 1px solid #f59e0b;">
|
|
<div class="flex items-start">
|
|
<i class="fas fa-exclamation-triangle mr-3 mt-1" style="color: #d97706;"></i>
|
|
<div class="text-sm" style="color: #92400e;">
|
|
<p class="font-medium mb-1">주의사항</p>
|
|
<ul class="list-disc list-inside space-y-1">
|
|
<li>이 설정은 최초 1회만 가능합니다</li>
|
|
<li>관리자 계정 정보를 안전하게 보관하세요</li>
|
|
<li>설정 완료 후 즉시 로그인됩니다</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 메인 애플리케이션 -->
|
|
<div id="mainApp" class="hidden min-h-screen">
|
|
<!-- 헤더 -->
|
|
<header class="bg-white shadow-sm border-b">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between items-center h-16">
|
|
<div class="flex items-center">
|
|
<i class="fas fa-tasks text-2xl text-blue-500 mr-3"></i>
|
|
<h1 class="text-xl font-semibold text-gray-800">Todo Project</h1>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-4">
|
|
<button onclick="goToClassify()" class="text-purple-600 hover:text-purple-800 font-medium">
|
|
<i class="fas fa-list-ul mr-1"></i>INDEX
|
|
<span class="ml-1 px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full" id="indexCount">0</span>
|
|
</button>
|
|
<button onclick="goToDashboard()" class="text-blue-600 hover:text-blue-800 font-medium">
|
|
<i class="fas fa-chart-line mr-1"></i>대시보드
|
|
</button>
|
|
<span class="text-sm text-gray-600" id="currentUser"></span>
|
|
<button onclick="logout()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 메인 컨텐츠 -->
|
|
<main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
<!-- 빠른 등록 안내 -->
|
|
<div class="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-xl p-6 mb-8 border border-blue-100">
|
|
<div class="text-center">
|
|
<i class="fas fa-plus-circle text-3xl text-blue-500 mb-3"></i>
|
|
<h2 class="text-xl font-semibold text-gray-800 mb-2">새 항목을 등록하시겠어요?</h2>
|
|
<p class="text-gray-600 mb-4">대시보드에서 사진과 메모를 함께 등록할 수 있습니다.</p>
|
|
<button onclick="goToDashboard()" class="btn-primary px-6 py-3 rounded-lg font-medium">
|
|
<i class="fas fa-chart-line mr-2"></i>대시보드에서 등록하기
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 등록된 항목들 -->
|
|
<div class="bg-white rounded-xl shadow-sm">
|
|
<div class="p-6 border-b">
|
|
<h2 class="text-lg font-semibold text-gray-800 mb-4">
|
|
<i class="fas fa-list text-blue-500 mr-2"></i>Todo 목록
|
|
</h2>
|
|
|
|
<!-- 분류 안내 -->
|
|
<div class="bg-blue-50 rounded-lg p-4 mb-4">
|
|
<p class="text-sm text-blue-800 mb-2">
|
|
<i class="fas fa-info-circle mr-2"></i>Todo 항목을 클릭하여 다른 카테고리로 변경하거나 내용을 수정하세요:
|
|
</p>
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-3 text-sm">
|
|
<div class="flex items-center text-blue-700">
|
|
<i class="fas fa-calendar-day mr-2"></i>
|
|
<span><strong>Todo:</strong> 시작 날짜가 있는 일</span>
|
|
</div>
|
|
<div class="flex items-center text-blue-700">
|
|
<i class="fas fa-calendar-times mr-2 text-orange-500"></i>
|
|
<span><strong>캘린더:</strong> 마감 기한이 있는 일</span>
|
|
</div>
|
|
<div class="flex items-center text-blue-700">
|
|
<i class="fas fa-check-square mr-2"></i>
|
|
<span><strong>체크리스트:</strong> 기한 없는 일</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="itemsList" class="divide-y divide-gray-100">
|
|
<!-- 등록된 항목들이 여기에 동적으로 추가됩니다 -->
|
|
</div>
|
|
|
|
<div id="emptyState" class="p-12 text-center text-gray-500">
|
|
<i class="fas fa-inbox text-4xl mb-4 opacity-50"></i>
|
|
<p>아직 Todo 항목이 없습니다.</p>
|
|
<p class="text-sm">위에서 새로운 항목을 등록해보세요!</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 분류 페이지 링크 -->
|
|
<div class="mt-8 grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
<!-- Todo 페이지 -->
|
|
<div class="bg-white rounded-xl shadow-sm p-6 hover:shadow-md transition-shadow cursor-pointer" onclick="goToPage('todo')">
|
|
<div class="text-center">
|
|
<div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<i class="fas fa-calendar-day text-2xl text-blue-600"></i>
|
|
</div>
|
|
<h3 class="text-lg font-semibold text-gray-800 mb-2">Todo</h3>
|
|
<p class="text-gray-600 text-sm mb-4">시작 날짜가 있는 일들</p>
|
|
<div class="bg-blue-50 rounded-lg p-3">
|
|
<span class="text-blue-800 font-medium" id="todoCount">0개</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 캘린더 페이지 -->
|
|
<div class="bg-white rounded-xl shadow-sm p-6 hover:shadow-md transition-shadow cursor-pointer" onclick="goToPage('calendar')">
|
|
<div class="text-center">
|
|
<div class="w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<i class="fas fa-calendar-times text-2xl text-orange-500"></i>
|
|
</div>
|
|
<h3 class="text-lg font-semibold text-gray-800 mb-2">캘린더</h3>
|
|
<p class="text-gray-600 text-sm mb-4">마감 기한이 있는 일들</p>
|
|
<div class="bg-orange-50 rounded-lg p-3">
|
|
<span class="text-orange-700 font-medium" id="calendarCount">0개</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 체크리스트 페이지 -->
|
|
<div class="bg-white rounded-xl shadow-sm p-6 hover:shadow-md transition-shadow cursor-pointer" onclick="goToPage('checklist')">
|
|
<div class="text-center">
|
|
<div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<i class="fas fa-check-square text-2xl text-green-600"></i>
|
|
</div>
|
|
<h3 class="text-lg font-semibold text-gray-800 mb-2">체크리스트</h3>
|
|
<p class="text-gray-600 text-sm mb-4">기한 없는 일들</p>
|
|
<div class="bg-green-50 rounded-lg p-3">
|
|
<span class="text-green-800 font-medium" id="checklistCount">0개</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 로딩 오버레이 -->
|
|
<div id="loadingOverlay" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
|
<div class="bg-white rounded-lg p-6 text-center">
|
|
<i class="fas fa-spinner fa-spin text-2xl text-indigo-600 mb-3"></i>
|
|
<p class="text-gray-700">처리 중...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- JavaScript -->
|
|
<script>
|
|
// 초기 설정 상태 확인
|
|
async function checkSetupStatus() {
|
|
try {
|
|
const response = await fetch('/api/setup/status');
|
|
const data = await response.json();
|
|
|
|
if (data.is_setup_required) {
|
|
// 초기 설정이 필요한 경우
|
|
document.getElementById('loginScreen').classList.add('hidden');
|
|
document.getElementById('setupScreen').classList.remove('hidden');
|
|
return false;
|
|
} else {
|
|
// 이미 설정된 경우 로그인 화면 표시
|
|
document.getElementById('setupScreen').classList.add('hidden');
|
|
document.getElementById('loginScreen').classList.remove('hidden');
|
|
return true;
|
|
}
|
|
} catch (error) {
|
|
console.error('설정 상태 확인 실패:', error);
|
|
// 오류 시 로그인 화면 표시
|
|
document.getElementById('setupScreen').classList.add('hidden');
|
|
document.getElementById('loginScreen').classList.remove('hidden');
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// 토큰 상태 확인
|
|
async function checkAuthStatus() {
|
|
console.log('=== 토큰 상태 확인 ===');
|
|
const existingToken = localStorage.getItem('authToken');
|
|
const existingUser = localStorage.getItem('currentUser');
|
|
|
|
console.log('기존 토큰 존재:', existingToken ? '있음' : '없음');
|
|
console.log('기존 사용자 정보:', existingUser);
|
|
|
|
// 토큰이 있으면 대시보드로 리다이렉트
|
|
if (existingToken && existingUser) {
|
|
console.log('유효한 토큰이 있습니다. 대시보드로 이동합니다.');
|
|
window.location.href = 'upload.html';
|
|
return;
|
|
}
|
|
|
|
// 토큰이 없으면 설정 상태 확인
|
|
await checkSetupStatus();
|
|
}
|
|
|
|
// 페이지 로드 시 상태 확인
|
|
checkAuthStatus();
|
|
</script>
|
|
|
|
<script src="static/js/api.js?v=20250921110800"></script>
|
|
<script src="static/js/image-utils.js?v=20250921110800"></script>
|
|
<script src="static/js/todos.js?v=20250921110800"></script>
|
|
<script src="static/js/auth.js?v=20250921110800"></script>
|
|
<script>
|
|
// 페이지 로드 시 디버깅 정보
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
console.log('=== 인덱스 페이지 로드 완료 ===');
|
|
|
|
console.log('AuthAPI 존재:', typeof AuthAPI !== 'undefined');
|
|
console.log('window.currentUser:', window.currentUser);
|
|
|
|
// 초기 설정 폼 이벤트 리스너
|
|
const setupForm = document.getElementById('setupForm');
|
|
if (setupForm) {
|
|
setupForm.addEventListener('submit', async (event) => {
|
|
event.preventDefault();
|
|
|
|
const username = document.getElementById('setupUsername').value;
|
|
const email = document.getElementById('setupEmail').value;
|
|
const password = document.getElementById('setupPassword').value;
|
|
const fullName = document.getElementById('setupFullName').value;
|
|
|
|
if (!username || !email || !password) {
|
|
alert('모든 필수 필드를 입력해주세요.');
|
|
return;
|
|
}
|
|
|
|
try {
|
|
console.log('시스템 초기화 시도...');
|
|
const response = await fetch('/api/setup/initialize', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify({
|
|
admin_username: username,
|
|
admin_email: email,
|
|
admin_password: password,
|
|
admin_full_name: fullName
|
|
})
|
|
});
|
|
|
|
const result = await response.json();
|
|
|
|
if (!response.ok) {
|
|
throw new Error(result.detail || '초기화 실패');
|
|
}
|
|
|
|
console.log('초기화 성공:', result);
|
|
alert('시스템이 성공적으로 초기화되었습니다!\\n생성된 계정으로 자동 로그인합니다.');
|
|
|
|
// 자동 로그인
|
|
const loginResult = await AuthAPI.login(username, password);
|
|
console.log('자동 로그인 성공:', loginResult);
|
|
window.location.href = 'upload.html';
|
|
|
|
} catch (error) {
|
|
console.error('초기화 실패:', error);
|
|
alert('초기화 실패: ' + error.message);
|
|
}
|
|
});
|
|
}
|
|
|
|
// 로그인 폼 이벤트 리스너 수동 추가 (백업)
|
|
const loginForm = document.getElementById('loginForm');
|
|
if (loginForm && !loginForm.hasAttribute('data-listener-added')) {
|
|
loginForm.setAttribute('data-listener-added', 'true');
|
|
loginForm.addEventListener('submit', async (event) => {
|
|
event.preventDefault();
|
|
console.log('수동 로그인 폼 제출 처리');
|
|
|
|
const username = document.getElementById('username').value;
|
|
const password = document.getElementById('password').value;
|
|
|
|
if (!username || !password) {
|
|
alert('사용자명과 비밀번호를 입력해주세요.');
|
|
return;
|
|
}
|
|
|
|
try {
|
|
console.log('로그인 시도:', username);
|
|
const result = await AuthAPI.login(username, password);
|
|
console.log('로그인 성공:', result);
|
|
window.location.href = 'upload.html';
|
|
} catch (error) {
|
|
console.error('로그인 실패:', error);
|
|
alert('로그인 실패: ' + error.message);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|