UI 개선: 테넌트 선택 헤더 이동 및 역할 권한 관리 개선
- 테넌트 선택을 각 페이지에서 헤더로 통합 이동 - 페이지 제목 이모지 제거 및 상단 여백(mt-6) 축소 - 역할 권한 관리 페이지 레이아웃을 다른 페이지와 통일 - 메뉴명 스타일 개선 (depth 들여쓰기, └ 기호 적용) - 상위 메뉴 컬럼 제거로 테이블 간소화 - RolePermissionService에 depth 계산 로직 추가 - pagination.js를 body 끝으로 이동하여 로딩 오류 해결 - 역할 선택 UI를 셀렉트박스에서 버튼 형태로 변경 - 역할 버튼 hover 효과 개선 (선택된 버튼 가독성 향상) 변경된 파일: - resources/views/partials/header.blade.php: 테넌트 선택 UI 추가 - resources/views/dashboard|menus|users|departments|permissions|roles/index.blade.php: tenant-selector 제거, 여백 축소 - resources/views/layouts/app.blade.php: pagination.js 위치 변경 - app/Services/RolePermissionService.php: depth 계산 로직 추가 - resources/views/role-permissions/: 역할 권한 관리 페이지 개선 - routes/web.php, routes/api.php: 역할 권한 관리 라우트 추가
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<div class="px-6 py-12 text-center">
|
||||
<div class="mx-auto max-w-lg">
|
||||
<div class="mb-4 flex justify-center">
|
||||
<div class="rounded-full bg-gray-100 p-3">
|
||||
<svg class="h-6 w-6 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="text-base font-semibold leading-6 text-gray-950">
|
||||
역할을 선택해주세요
|
||||
</h4>
|
||||
<p class="mt-2 text-sm text-gray-600">
|
||||
상단에서 역할을 선택하면 해당 역할의 권한을 설정할 수 있습니다.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,66 @@
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 60px;">순번</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">URL</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">순서</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">조회</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">생성</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">수정</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">삭제</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">승인</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 80px;">내보내기</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider" style="width: 70px;">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@php
|
||||
$permissionTypes = ['view', 'create', 'update', 'delete', 'approve', 'export', 'manage'];
|
||||
@endphp
|
||||
@forelse($menus as $index => $menu)
|
||||
<tr>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 text-center">
|
||||
{{ $index + 1 }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center text-sm text-gray-900" style="padding-left: {{ ($menu->depth ?? 0) * 20 }}px;">
|
||||
@if(($menu->depth ?? 0) > 0)
|
||||
<span class="mr-2 text-gray-400">└</span>
|
||||
@endif
|
||||
<span>{{ $menu->name }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<span class="truncate max-w-xs inline-block" title="{{ $menu->url }}">
|
||||
{{ $menu->url }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 text-center">
|
||||
{{ $menu->sort_order }}
|
||||
</td>
|
||||
@foreach($permissionTypes as $type)
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
{{ isset($permissions[$menu->id][$type]) && $permissions[$menu->id][$type] ? 'checked' : '' }}
|
||||
class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"
|
||||
hx-post="/api/admin/role-permissions/toggle"
|
||||
hx-target="#permission-matrix"
|
||||
hx-include="[name='role_id']"
|
||||
hx-vals='{"menu_id": {{ $menu->id }}, "permission_type": "{{ $type }}"}'
|
||||
>
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="11" class="px-6 py-12 text-center text-gray-500">
|
||||
활성화된 메뉴가 없습니다.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user