feat: 완전한 문서 관리 시스템 구현

 주요 기능:
- 문서 사라짐 문제 해결: API limit 제한으로 인한 문서 누락 해결
- 서적별 문서 관리: HTML과 PDF 통합 관리 시스템
- PDF 뷰어 개선: 인증, 네비게이션, 에러 처리 강화
- 서적 편집/삭제: 완전한 서적 관리 기능

🔧 기술적 개선:
- /api/documents/all 엔드포인트 추가 (모든 문서 조회)
- HTML/PDF 문서 타입별 아이콘 및 필터링
- 서적별 뷰에서 편집/삭제 버튼 추가
- PDF Manager와 서적 편집 페이지 연동

🎨 UI/UX 개선:
- Devonthink 스타일 서적 그룹화
- HTML 문서 순서 관리와 PDF 관리 섹션 분리
- 문서 타입별 시각적 구분 (HTML: 파란색, PDF: 빨간색)
- 2단계 확인을 통한 안전한 서적 삭제

�� 버그 수정:
- PDF 삭제 시 undefined ID 전달 문제 해결
- 서적 편집 페이지 422 오류 해결 (URL 파라미터 문제)
- PDF.js 워커 설정 및 인증 토큰 처리 개선
This commit is contained in:
hyungi
2025-09-05 11:00:17 +09:00
parent cfb9485d4f
commit 6a537008db
85 changed files with 375 additions and 28 deletions

View File

@@ -95,16 +95,29 @@
rows="3"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"></textarea>
</div>
<!-- 서적 관리 버튼들 -->
<div class="flex justify-between pt-4 border-t border-gray-200">
<button @click="deleteBook()"
class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors">
<i class="fas fa-trash mr-2"></i>서적 삭제
</button>
<button @click="saveBookInfo()"
class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
<i class="fas fa-save mr-2"></i>서적 정보 저장
</button>
</div>
</div>
</div>
<!-- 문서 순서 및 PDF 매칭 편집 -->
<!-- HTML 문서 순서 및 PDF 매칭 편집 -->
<div class="bg-white rounded-lg shadow-sm border">
<div class="p-6 border-b border-gray-200">
<div class="flex items-center justify-between">
<h2 class="text-lg font-semibold text-gray-900 flex items-center">
<i class="fas fa-list-ol mr-2 text-green-600"></i>
문서 순서 및 PDF 매칭
<i class="fas fa-list-ol mr-2 text-blue-600"></i>
HTML 문서 순서 및 PDF 매칭
</h2>
<div class="flex space-x-2">
<button @click="autoSortByName()"
@@ -138,15 +151,22 @@
<!-- 문서 정보 -->
<div class="flex-1">
<h3 class="font-medium text-gray-900" x-text="doc.title"></h3>
<div class="flex items-center space-x-2">
<!-- 문서 타입 아이콘 -->
<i x-show="doc.html_path && !doc.pdf_path" class="fas fa-file-alt text-blue-500" title="HTML 문서"></i>
<i x-show="doc.pdf_path && !doc.html_path" class="fas fa-file-pdf text-red-500" title="PDF 문서"></i>
<i x-show="doc.html_path && doc.pdf_path" class="fas fa-file-archive text-purple-500" title="HTML + PDF"></i>
<h3 class="font-medium text-gray-900" x-text="doc.title"></h3>
</div>
<p class="text-sm text-gray-500" x-text="doc.description || '설명 없음'"></p>
</div>
</div>
<!-- PDF 매칭 및 컨트롤 -->
<div class="flex items-center space-x-3">
<!-- PDF 매칭 드롭다운 -->
<div class="min-w-48 relative">
<!-- PDF 매칭 드롭다운 (HTML 문서만) -->
<div x-show="doc.html_path" class="min-w-48 relative">
<select x-model="doc.matched_pdf_id"
:class="doc.matched_pdf_id ? 'border-green-300 bg-green-50' : 'border-gray-300'"
class="w-full px-3 py-2 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm">
@@ -187,6 +207,67 @@
</div>
</div>
</div>
<!-- PDF 전용 문서 관리 -->
<div class="bg-white rounded-lg shadow-sm border">
<div class="p-6 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-900 flex items-center">
<i class="fas fa-file-pdf mr-2 text-red-600"></i>
등록된 PDF 문서 관리
<span class="ml-2 px-2 py-1 bg-red-100 text-red-700 text-xs rounded-full" x-text="pdfDocuments.length + '개'"></span>
</h2>
</div>
<div class="p-6">
<!-- PDF 문서 목록 -->
<div class="space-y-3">
<template x-for="(pdf, index) in pdfDocuments" :key="pdf.id">
<div class="bg-red-50 border border-red-200 rounded-lg p-4 hover:bg-red-100 transition-colors">
<div class="flex items-center justify-between">
<div class="flex items-center flex-1">
<!-- PDF 아이콘 -->
<div class="w-10 h-10 bg-red-600 text-white rounded-full flex items-center justify-center text-sm font-medium mr-4">
<i class="fas fa-file-pdf"></i>
</div>
<!-- PDF 정보 -->
<div class="flex-1">
<div class="flex items-center space-x-2">
<h3 class="font-medium text-gray-900" x-text="pdf.title"></h3>
<span class="px-2 py-1 bg-red-100 text-red-700 text-xs rounded-full">PDF 전용</span>
</div>
<p class="text-sm text-gray-500" x-text="pdf.description || '설명 없음'"></p>
<div class="flex items-center space-x-4 text-xs text-gray-400 mt-1">
<span x-text="pdf.original_filename"></span>
<span x-text="new Date(pdf.created_at).toLocaleDateString()"></span>
<span x-show="pdf.file_size" x-text="Math.round(pdf.file_size / 1024) + 'KB'"></span>
</div>
</div>
</div>
<!-- PDF 관리 버튼들 -->
<div class="flex items-center space-x-2">
<button @click="previewPDF(pdf)"
class="px-3 py-1.5 bg-blue-100 text-blue-700 rounded-md hover:bg-blue-200 transition-colors text-sm">
<i class="fas fa-eye mr-1"></i>미리보기
</button>
<button @click="deletePDF(pdf)"
class="px-3 py-1.5 bg-red-100 text-red-700 rounded-md hover:bg-red-200 transition-colors text-sm">
<i class="fas fa-trash mr-1"></i>삭제
</button>
</div>
</div>
</div>
</template>
</div>
<!-- 빈 상태 -->
<div x-show="pdfDocuments.length === 0" class="text-center py-8">
<i class="fas fa-file-pdf text-gray-400 text-3xl mb-4"></i>
<p class="text-gray-500">등록된 PDF 문서가 없습니다</p>
</div>
</div>
</div>
</div>
</main>