@extends('layouts.app') @section('content')

{{ \App\Helpers\TranslationHelper::transFromDatabase('API Settings', __('API Settings')) }}

{{ \App\Helpers\TranslationHelper::transFromDatabase('Manage API integrations with third-party medical services.', __('إدارة مفاتيح الربط والتكامل البرمجي مع الخدمات الطبية الخارجية والأنظمة الأخرى.')) }}

@csrf
{{ __('صلاحيات الوصول التفصيلية:') }}
@php $modules = [ 'patients' => __('المرضى'), 'appointments' => __('المواعيد'), 'emr' => __('السجل الطبي'), 'laboratory' => __('المختبر'), 'pharmacy' => __('الصيدلية') ]; $actions = [ 'read' => ['label' => __('قراءة'), 'color' => 'blue'], 'write' => ['label' => __('إضافة/تعديل'), 'color' => 'green'], 'delete' => ['label' => __('حذف'), 'color' => 'red'] ]; @endphp @foreach($modules as $modKey => $modLabel)
{{ $modLabel }} @foreach($actions as $actKey => $actInfo) @endforeach
@endforeach

{{ __('مفاتيح الوصول الحالية') }}

@forelse($apiKeys as $apiKey) @empty @endforelse
{{ __('اسم المفتاح') }} {{ __('الصلاحيات') }} {{ __('مفتاح API') }} {{ __('الحالة') }} {{ __('آخر استخدام') }} {{ __('العمليات') }}
{{ $apiKey->name }} @if($apiKey->permissions)
@foreach($apiKey->permissions as $perm) @php if (str_contains($perm, ':')) { [$mod, $act] = explode(':', $perm); $color = $act == 'read' ? 'blue' : ($act == 'write' ? 'green' : 'red'); $modName = $modules[$mod] ?? $mod; $actName = $actions[$act]['label'] ?? $act; } else { $modName = $modules[$perm] ?? $perm; $actName = __('وصول كامل'); $color = 'gray'; } @endphp {{ $modName }}: {{ $actName }} @endforeach
@else {{ __('وصول كامل') }} @endif
@php $parts = explode('_', $apiKey->api_key); $prefix = $parts[0] . '_' . $parts[1] . '_'; @endphp {{ $prefix . str_repeat('•', 16) }} @if($apiKey->active) {{ __('نشط') }} @else {{ __('معطل') }} @endif {{ $apiKey->last_used_at ? $apiKey->last_used_at->diffForHumans() : __('لم يستخدم بعد') }}
@csrf @method('PATCH')
|
@csrf @method('DELETE')
{{ __('لا توجد مفاتيح وصول حالية') }}
@endsection @push('scripts') @endpush