chore: 관리 페이지 뷰 및 라우트 정비
- ArchivedRecordController 수정 - 각종 테이블 뷰 개선 (archived-records, boards, departments, menus, tenants) - web.php 라우트 정비
This commit is contained in:
@@ -16,20 +16,18 @@ public function __construct(
|
||||
/**
|
||||
* 아카이브 레코드 목록 조회 (batch 그룹핑)
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
public function index(Request $request): JsonResponse|\Illuminate\Http\Response
|
||||
{
|
||||
$records = $this->archivedRecordService->getArchivedRecordsBatched(
|
||||
$request->all(),
|
||||
$request->integer('per_page', 15)
|
||||
);
|
||||
|
||||
// HTMX 요청 시 HTML 반환
|
||||
// HTMX 요청 시 HTML 직접 반환
|
||||
if ($request->header('HX-Request')) {
|
||||
$html = view('archived-records.partials.table', compact('records'))->render();
|
||||
|
||||
return response()->json([
|
||||
'html' => $html,
|
||||
]);
|
||||
return response($html)->header('Content-Type', 'text/html');
|
||||
}
|
||||
|
||||
// 일반 요청 시 JSON 반환
|
||||
|
||||
@@ -97,19 +97,5 @@ class="bg-white rounded-lg shadow-sm overflow-hidden">
|
||||
e.preventDefault();
|
||||
htmx.trigger('#archived-record-table', 'filterSubmit');
|
||||
});
|
||||
|
||||
// HTMX 응답 처리
|
||||
document.body.addEventListener('htmx:afterSwap', function(event) {
|
||||
if (event.detail.target.id === 'archived-record-table') {
|
||||
try {
|
||||
const response = JSON.parse(event.detail.xhr.response);
|
||||
if (response.html) {
|
||||
event.detail.target.innerHTML = response.html;
|
||||
}
|
||||
} catch (e) {
|
||||
// JSON 파싱 실패 시 HTML 직접 사용
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -69,11 +69,15 @@ class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-2">
|
||||
@if($board->trashed())
|
||||
<!-- 삭제된 항목 액션 -->
|
||||
<!-- 삭제된 항목 - 슈퍼관리자만 복구/영구삭제 가능 -->
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmRestore({{ $board->id }}, '{{ $board->name }}')"
|
||||
class="text-green-600 hover:text-green-900">복원</button>
|
||||
<button onclick="confirmForceDelete({{ $board->id }}, '{{ $board->name }}')"
|
||||
class="text-red-600 hover:text-red-900">영구삭제</button>
|
||||
@else
|
||||
<span class="text-gray-400 text-xs">삭제됨</span>
|
||||
@endif
|
||||
@else
|
||||
<!-- 일반 항목 액션 -->
|
||||
<a href="{{ route('boards.edit', $board->id) }}"
|
||||
|
||||
@@ -44,12 +44,17 @@
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||
@if($department->trashed())
|
||||
<!-- 삭제된 항목 - 슈퍼관리자만 복구/영구삭제 가능 -->
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmRestore({{ $department->id }}, '{{ $department->name }}')" class="text-green-600 hover:text-green-900 mr-3">
|
||||
복원
|
||||
</button>
|
||||
<button onclick="confirmForceDelete({{ $department->id }}, '{{ $department->name }}')" class="text-red-600 hover:text-red-900">
|
||||
영구삭제
|
||||
</button>
|
||||
@else
|
||||
<span class="text-gray-400 text-xs">삭제됨</span>
|
||||
@endif
|
||||
@else
|
||||
<a href="{{ route('departments.edit', $department->id) }}" class="text-blue-600 hover:text-blue-900 mr-3">
|
||||
수정
|
||||
|
||||
@@ -95,16 +95,18 @@ class="relative inline-flex h-4 w-8 items-center rounded-full transition-colors
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||
@if($menu->deleted_at)
|
||||
<!-- 삭제된 항목 -->
|
||||
<!-- 삭제된 항목 - 슈퍼관리자만 복구/영구삭제 가능 -->
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmRestore({{ $menu->id }}, '{{ $menu->name }}')"
|
||||
class="text-green-600 hover:text-green-900 mr-3">
|
||||
복원
|
||||
</button>
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmForceDelete({{ $menu->id }}, '{{ $menu->name }}')"
|
||||
class="text-red-600 hover:text-red-900">
|
||||
영구삭제
|
||||
</button>
|
||||
@else
|
||||
<span class="text-gray-400 text-xs">삭제됨</span>
|
||||
@endif
|
||||
@else
|
||||
<!-- 활성 항목 -->
|
||||
|
||||
@@ -84,16 +84,18 @@
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium" onclick="event.stopPropagation()">
|
||||
@if($tenant->deleted_at)
|
||||
<!-- 삭제된 항목 -->
|
||||
<!-- 삭제된 항목 - 슈퍼관리자만 복구/영구삭제 가능 -->
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmRestore({{ $tenant->id }}, '{{ $tenant->company_name }}')"
|
||||
class="text-green-600 hover:text-green-900 mr-3">
|
||||
복원
|
||||
</button>
|
||||
@if(auth()->user()?->is_super_admin)
|
||||
<button onclick="confirmForceDelete({{ $tenant->id }}, '{{ $tenant->company_name }}')"
|
||||
class="text-red-600 hover:text-red-900">
|
||||
영구삭제
|
||||
</button>
|
||||
@else
|
||||
<span class="text-gray-400 text-xs">삭제됨</span>
|
||||
@endif
|
||||
@else
|
||||
<!-- 활성 항목 -->
|
||||
|
||||
@@ -29,9 +29,11 @@
|
||||
|--------------------------------------------------------------------------
|
||||
| Authenticated Routes (인증 필요)
|
||||
|--------------------------------------------------------------------------
|
||||
| - auth: 기본 인증 확인
|
||||
| - hq.member: 본사(HQ) 테넌트 소속 확인
|
||||
*/
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::middleware(['auth', 'hq.member'])->group(function () {
|
||||
Route::post('/logout', [LoginController::class, 'logout'])->name('logout');
|
||||
|
||||
// 테넌트 전환
|
||||
|
||||
Reference in New Issue
Block a user