[REFACTOR] 簡化權限管理介面,整合權限設定至角色管理,並完成多語系支援
This commit is contained in:
@@ -21,7 +21,10 @@
|
||||
},
|
||||
openEditModal(user) {
|
||||
this.editing = true;
|
||||
this.currentUser = { ...user };
|
||||
this.currentUser = {
|
||||
...user,
|
||||
role: user.roles && user.roles.length > 0 ? user.roles[0].name : 'user'
|
||||
};
|
||||
this.showModal = true;
|
||||
}
|
||||
}">
|
||||
@@ -49,6 +52,7 @@
|
||||
</svg>
|
||||
</span>
|
||||
<input type="text" name="search" value="{{ request('search') }}" class="py-3 pl-12 pr-6 block w-full md:w-80 luxury-input" placeholder="{{ __('Search users...') }}">
|
||||
<input type="hidden" name="per_page" value="{{ request('per_page', 10) }}">
|
||||
</div>
|
||||
|
||||
@if(auth()->user()->isSystemAdmin())
|
||||
@@ -60,12 +64,6 @@
|
||||
</select>
|
||||
@endif
|
||||
|
||||
<select name="limit" onchange="this.form.submit()" class="luxury-select w-full md:w-auto text-[11px]">
|
||||
<option value="10" {{ request('limit') == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ request('limit') == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ request('limit') == 50 ? 'selected' : '' }}>50</option>
|
||||
<option value="100" {{ request('limit') == 100 ? 'selected' : '' }}>100</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
@@ -211,9 +209,9 @@
|
||||
<div class="space-y-2">
|
||||
<label class="text-xs font-black text-slate-500 uppercase tracking-widest pl-1">{{ __('Role') }}</label>
|
||||
<select name="role" x-model="currentUser.role" class="luxury-select">
|
||||
<option value="user">{{ __('User') }}</option>
|
||||
<option value="admin">{{ __('Admin') }}</option>
|
||||
<option value="super-admin">{{ __('Super Admin') }}</option>
|
||||
@foreach($roles as $role)
|
||||
<option value="{{ $role->name }}">{{ __($role->name) }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user