Files
sam-manage/resources/views/archived-records/show.blade.php
hskwon 6ad76239a9 feat(mng): 삭제된 데이터 백업 기능 추가
- ArchivedRecord, ArchivedRecordRelation 모델 추가
- ArchivedRecordService 추가 (읽기 전용)
- 목록/상세 컨트롤러 및 뷰 구현
- HTMX 기반 테이블 필터링 및 페이지네이션
- 사이드바 메뉴 연결
2025-11-26 22:23:37 +09:00

113 lines
5.5 KiB
PHP

@extends('layouts.app')
@section('title', '삭제된 데이터 상세')
@section('content')
<!-- 페이지 헤더 -->
<div class="flex justify-between items-center mb-6">
<div class="flex items-center gap-4">
<a href="{{ route('archived-records.index') }}"
class="text-gray-500 hover:text-gray-700 transition">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</a>
<h1 class="text-2xl font-bold text-gray-800">삭제된 데이터 상세</h1>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium {{ $record->record_type === 'tenant' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800' }}">
{{ $record->record_type_label }}
</span>
</div>
</div>
<!-- 기본 정보 -->
<div class="bg-white rounded-lg shadow-sm mb-6">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-800">기본 정보</h2>
</div>
<div class="p-6">
<dl class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div>
<dt class="text-sm font-medium text-gray-500">ID</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $record->id }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">레코드 타입</dt>
<dd class="mt-1">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {{ $record->record_type === 'tenant' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800' }}">
{{ $record->record_type_label }}
</span>
</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">원본 ID</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $record->original_id }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">스키마 버전</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $record->schema_version ?? '-' }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">삭제자</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $record->deletedByUser?->name ?? '-' }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">삭제일시</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $record->deleted_at?->format('Y-m-d H:i:s') ?? '-' }}</dd>
</div>
@if($record->notes)
<div class="md:col-span-2 lg:col-span-3">
<dt class="text-sm font-medium text-gray-500">노트</dt>
<dd class="mt-1 text-sm text-gray-900 bg-gray-50 p-3 rounded">{{ $record->notes }}</dd>
</div>
@endif
</dl>
</div>
</div>
<!-- 메인 데이터 -->
<div class="bg-white rounded-lg shadow-sm mb-6">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-800">메인 데이터</h2>
</div>
<div class="p-6">
@if($record->main_data)
<pre class="bg-gray-900 text-green-400 p-4 rounded-lg overflow-x-auto text-sm font-mono">{{ json_encode($record->main_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
@else
<p class="text-gray-500">데이터가 없습니다.</p>
@endif
</div>
</div>
<!-- 관련 테이블 데이터 -->
@if($record->relations->isNotEmpty())
<div class="bg-white rounded-lg shadow-sm">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-800">관련 테이블 데이터</h2>
<p class="text-sm text-gray-500 mt-1"> {{ $record->relations->count() }} 테이블</p>
</div>
<div class="p-6 space-y-6">
@foreach($record->relations as $relation)
<div class="border border-gray-200 rounded-lg">
<div class="px-4 py-3 bg-gray-50 border-b border-gray-200 flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="font-medium text-gray-900">{{ $relation->table_name_label }}</span>
<span class="text-xs text-gray-500">({{ $relation->table_name }})</span>
</div>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-200 text-gray-800">
{{ $relation->record_count }}
</span>
</div>
<div class="p-4">
@if($relation->data)
<pre class="bg-gray-900 text-green-400 p-4 rounded-lg overflow-x-auto text-sm font-mono max-h-96">{{ json_encode($relation->data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
@else
<p class="text-gray-500">데이터가 없습니다.</p>
@endif
</div>
</div>
@endforeach
</div>
</div>
@endif
@endsection