{{-- resources/views/superadmin/falcon-room/moderators.blade.php --}} @extends('layouts.superadmin') @section('title','غرفة الصقر — الإداريون (مشرفون + سوبر أدمن)') @section('page-title','🛡️ مراقبة الإداريين') @section('content') @php use Illuminate\Support\Str; // ترجمة اسم الصفحة حسب config/page_names $pageMap = config('page_names', []); $toArabic = function($raw) use ($pageMap) { $key = Str::of((string)$raw)->lower() ->replace([' ','.','/'],'-')->replaceMatches('/-+/', '-')->trim('-')->value(); return $pageMap[$key] ?? Str::of($key)->replace('-', ' ')->title(); }; // Fallbacks آمنة $moderators = $moderators ?? collect(); $admins = $admins ?? collect(); $topPages = $topPages ?? collect(); $activityData = $activityData ?? []; $scope = request('scope','moderators'); // moderators | admins | both $stats = array_merge([ 'total_moderators' => (method_exists($moderators,'total') ? $moderators->total() : (is_iterable($moderators)?count($moderators):0)), 'total_admins' => (method_exists($admins,'total') ? $admins->total() : (is_iterable($admins)?count($admins):0)), 'active_today' => 0, 'online_now' => 0, 'avg_load' => 0, ], $stats ?? []); // تنسيق السرعة $fmtMs = fn($ms)=> $ms>=1000 ? number_format($ms/1000,2).' ث' : (int)$ms.' ms'; // بادج الدور $roleBadge = function($r){ return match($r){ 'super-admin' => ['bg'=>'bg-rose-100 text-rose-800', 'label'=>'سوبر أدمن'], 'moderator' => ['bg'=>'bg-blue-100 text-blue-800', 'label'=>'مشرف'], default => ['bg'=>'bg-gray-100 text-gray-800', 'label'=>$r], }; }; @endphp
تتبّع نشاط المشرفين والسوبر أدمن من حيث الجلسات، الصفحات، الأجهزة، ومتوسط السرعة. الفلاتر أدناه تحصر الفترة والنطاق.
إجمالي المشرفين
{{ number_format($stats['total_moderators']) }}
إجمالي السوبر أدمن
{{ number_format($stats['total_admins']) }}
نشط اليوم
{{ number_format($stats['active_today']) }}
متصل الآن
{{ number_format($stats['online_now']) }}
متوسط السرعة
{{ $fmtMs($stats['avg_load']) }}
| الاسم | الدور | الجنس | الجلسات | الصفحات | الأجهزة | السرعة | آخر نشاط | إجراءات |
|---|---|---|---|---|---|---|---|---|
|
{{ $mod->name ?? '—' }}
{{ $mod->email ?? '—' }}
|
{{ $r['label'] }} | {{ $gender['lbl'] }} | {{ number_format($mod->total_sessions ?? 0) }} | {{ number_format($mod->total_pages_visited ?? 0) }} | {{ (int)($mod->devices_count ?? 0) }} | {{ $fmtMs($mod->avg_load_time ?? 0) }} | {{ !empty($mod->last_activity) ? \Carbon\Carbon::parse($mod->last_activity)->diffForHumans() : '—' }} | 📊 التفاصيل |
| لا يوجد بيانات. | ||||||||