@extends('layouts.admin') @php $routeName = request()->route()->getName(); $baseRoute = str_contains($routeName, 'sub-accounts') ? 'admin.data-config.sub-accounts' : 'admin.permission.accounts'; $tab = request('tab', 'accounts'); $roleSelectConfig = [ "placeholder" => __('Select Role'), "hasSearch" => true, "searchPlaceholder" => __('Search Role...'), "isHidePlaceholder" => false, "searchClasses" => "block w-[calc(100%-16px)] mx-2 py-2 px-3 text-sm border-slate-200 dark:border-white/10 rounded-lg focus:border-cyan-500 focus:ring-cyan-500 bg-slate-50 dark:bg-slate-900/50 dark:text-slate-200 placeholder:text-slate-400 dark:placeholder:text-slate-500", "searchWrapperClasses" => "sticky top-0 bg-white/95 dark:bg-slate-900/95 backdrop-blur-md p-2 z-10", "toggleClasses" => "hs-select-toggle luxury-select-toggle", "dropdownClasses" => "hs-select-menu w-full bg-white/95 dark:bg-slate-900/95 backdrop-blur-xl border border-slate-200 dark:border-white/10 rounded-xl shadow-[0_20px_50px_rgba(0,0,0,0.3)] mt-2 z-[100] animate-luxury-in", "optionClasses" => "hs-select-option py-2.5 px-3 mb-0.5 text-sm text-slate-800 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-cyan-500/10 dark:hover:text-cyan-400 rounded-lg flex items-center justify-between transition-all duration-300", "optionTemplate" => '
' ]; @endphp @section('content')

{{ $title }}

{{ __('Manage administrative and tenant accounts') }}

@if($tab === 'accounts') @endif
{{ __('Account Management') }} {{ __('Authorized Machines') }}
@if(auth()->user()->isSystemAdmin())
@endif
@if($tab === 'accounts') @if(auth()->user()->isSystemAdmin()) @endif @forelse($users as $user) @if(auth()->user()->isSystemAdmin()) @endif @empty @endforelse
{{ __('User Info') }} {{ __('Contact Info') }} {{ __('Affiliation') }} {{ __('Role') }} {{ __('Status') }} {{ __('Actions') }}
@if($user->avatar) @else @endif
{{ $user->name }} {{ $user->username }}
@if($user->phone) {{ $user->phone }} @endif {{ $user->email ?? '-' }}
@if($user->company) {{ $user->company->name }} @else {{ __('SYSTEM') }} @endif @foreach($user->roles as $role) {{ $role->name }} @endforeach @if($user->status) {{ __('Active') }} @else {{ __('Disabled') }} @endif
@if(!$user->hasRole('super-admin') || auth()->user()->hasRole('super-admin')) @if($user->status) @else @endif
@csrf @method('DELETE')
@else {{ __('Protected') }} @endif

{{ __('No accounts found') }}

@else @if(auth()->user()->isSystemAdmin()) @endif @foreach ($users as $account) @if(auth()->user()->isSystemAdmin()) @endif @endforeach
{{ __('User Info') }} {{ __('Affiliation') }} {{ __('Authorized Machines') }} {{ __('Action') }}
@if($account->avatar) @else @endif
{{ $account->name }} {{ $account->username }}
@if($account->company) {{ $account->company->name }} @else {{ __('SYSTEM') }} @endif
@if(!$account->company_id) {{ __('Full Access') }} @else @php $assigned = $account->machines; @endphp @if($assigned->isNotEmpty()) @foreach($assigned->take(3) as $machine) {{ $machine->name }} @endforeach @if($assigned->count() > 3) +{{ $assigned->count() - 3 }} @endif @else {{ __('No machines assigned') }} @endif @endif
@if(!$account->company_id) {{ __('System Default') }} @else @endif
@endif
{{ $users->appends(['tab' => $tab])->links('vendor.pagination.luxury') }}

@csrf
@if(auth()->user()->isSystemAdmin())
{{-- 選項由組件根據 placeholder 自動生成 value=' ' 的項目 --}} @foreach($companies as $company) @endforeach
@endif
@endsection @section('scripts') @endsection