@extends('app-admin.layout') @section('title', $module->name.' — Wavora Admin') @section('page-title', $module->name) @section('page-sub', 'Module: '.$module->code) @php use App\Models\Tenant; use App\Models\WaDevice; use App\Models\Plan; use App\Models\Message; use App\Models\Webhook; use App\Models\ApiKey; use App\Models\Subscription; use App\Models\Invoice; use App\Models\GatewayNode; use App\Models\AuditLog; use App\Models\User; $code = $module->code; @endphp @section('topbar-actions') @if($code === 'tenants') @elseif($code === 'plans') @if(auth()->user()->canDoAction('plans', 'edit')) @endif @elseif($code === 'devices') @endif @endsection @section('content') {{-- ─── TENANTS ─── --}} @if($code === 'tenants') @php $tenants = Tenant::withCount(['waDevices','members'])->latest()->paginate(20); @endphp
| Tenant | Devices | Members | Status | Joined | |
|---|---|---|---|---|---|
|
{{ strtoupper(substr($t->name,0,1)) }}
{{ $t->name }}
{{ $t->slug ?? $t->id }}
|
{{ $t->email ?? '—' }} | {{ $t->wa_devices_count }} | {{ $t->members_count }} | @php $s = $t->status ?? 'active'; @endphp {{ $s }} | {{ $t->created_at?->format('d M Y') }} |
corporate_fare No tenants yet | |||||
| Name | Role | Joined | |
|---|---|---|---|
|
{{ strtoupper(substr($u->name,0,1)) }}
{{ $u->name }}
|
{{ $u->email }} | {{ $u->group?->name ?? 'admin' }} | {{ $u->created_at?->format('d M Y') }} |
group No users | |||
| Label | Phone | Tenant | Plan | Status | Action |
|---|---|---|---|---|---|
|
smartphone
{{ $d->label ?? $d->name ?? 'Device' }}
|
{{ $d->phone_number ?? $d->phone ?? '—' }} | {{ $d->tenant?->name ?? '—' }} | @php $activePlan = $d->devicePlans->where('status', 'active')->first(); $planName = $activePlan ? $activePlan->plan->name : 'No Plan'; @endphp {{ $planName }} | @php $s = $d->status ?? 'unknown'; @endphp {{ $s }} | settings Manage |
smartphone No devices | |||||
| To | Type | Tenant | Device | Status | Time |
|---|---|---|---|---|---|
| {{ $m->to ?? $m->recipient ?? '—' }} | {{ $m->type ?? 'text' }} | {{ $m->tenant?->name ?? '—' }} | {{ $m->waDevice?->label ?? '—' }} | @php $s=$m->status??'queued'; $c=match($s){'sent'=>'badge-green','failed'=>'badge-red','queued'=>'badge-yellow','processing'=>'badge-blue',default=>'badge-gray'}; @endphp {{ $s }} | {{ $m->created_at?->format('d M H:i') }} |
forum No messages | |||||
No plans yet. Seed the database.
| Fitur & Batasan | @foreach($plans as $p)
{{ $p->name }}
{{ $p->code }}
|
@endforeach
|---|---|
| Harga Bulanan | @foreach($plans as $p)@if($p->price_monthly == 0) Free @else Rp{{ number_format($p->price_monthly,0,',','.') }} @endif | @endforeach
| Harga 3 Bulan | @foreach($plans as $p)@if(($p->price_3_months ?? 0) == 0) Free @else Rp{{ number_format($p->price_3_months,0,',','.') }} @endif | @endforeach
| Harga 6 Bulan | @foreach($plans as $p)@if(($p->price_6_months ?? 0) == 0) Free @else Rp{{ number_format($p->price_6_months,0,',','.') }} @endif | @endforeach
| Harga 12 Bulan | @foreach($plans as $p)@if(($p->price_12_months ?? 0) == 0) Free @else Rp{{ number_format($p->price_12_months,0,',','.') }} @endif | @endforeach
| Pesan Per Hari | @foreach($plans as $p)@if(isset($p->limits['messages_per_day']) && $p->limits['messages_per_day'] !== '' && $p->limits['messages_per_day'] > 0) {{ number_format($p->limits['messages_per_day']) }} / hari @else Unlimited @endif | @endforeach
| Pesan Per Bulan | @foreach($plans as $p)@if(isset($p->limits['messages_per_month']) && $p->limits['messages_per_month'] !== '' && $p->limits['messages_per_month'] > 0) {{ number_format($p->limits['messages_per_month']) }} / bulan @else Unlimited @endif | @endforeach
| Batas Operator | @foreach($plans as $p){{ number_format($p->limits['operators'] ?? 1) }} Operator | @endforeach
| Tanpa Branding Footer | @foreach($plans as $p)@if(in_array('mandatory_footer', $p->features ?? [])) Wajib Branding @else Tanpa Branding @endif | @endforeach
| Status Aktif | @foreach($plans as $p){{ $p->is_active?'Aktif':'Nonaktif' }} | @endforeach
| URL | Tenant | Events | Status | Created |
|---|---|---|---|---|
| {{ $h->tenant?->name ?? '—' }} | {{ is_array($h->events)?implode(', ',$h->events):($h->events??'all') }} | {{ $h->is_active?'Active':'Disabled' }} | {{ $h->created_at?->format('d M Y') }} | |
webhook No webhooks | ||||
| Name | Tenant | Key (masked) | Status | Last Used |
|---|---|---|---|---|
| {{ $k->name ?? 'API Key' }} | {{ $k->tenant?->name ?? '—' }} | {{ '••••'.substr($k->key_hash??'',0,8) }} | {{ $k->is_active?'Active':'Revoked' }} | {{ $k->last_used_at?->diffForHumans() ?? '—' }} |
key No API keys | ||||
| Tenant | Plan | Status | Expires | Created |
|---|---|---|---|---|
| {{ $s->tenant?->name ?? '—' }} | {{ $s->plan?->name ?? '—' }} | @php $st=$s->status??'active'; $sc=match($st){'active'=>'badge-green','past_due'=>'badge-yellow','suspended','cancelled','expired'=>'badge-red',default=>'badge-gray'}; @endphp {{ $st }} | {{ $s->expires_at?->format('d M Y') ?? '∞' }} | {{ $s->created_at?->format('d M Y') }} |
receipt_long No subscriptions | ||||
| Invoice # | Tenant | Amount | Status | Due | Created |
|---|---|---|---|---|---|
| #{{ $inv->invoice_number ?? substr($inv->id,0,8) }} | {{ $inv->tenant?->name ?? '—' }} | Rp{{ number_format($inv->grand_total??0,0,',','.') }} | @php $st=$inv->status??'pending'; $sc=match($st){'paid'=>'badge-green','pending'=>'badge-yellow','overdue'=>'badge-red','cancelled'=>'badge-gray',default=>'badge-gray'}; @endphp {{ $st }} | {{ $inv->due_date?->format('d M Y') ?? '—' }} | {{ $inv->created_at?->format('d M Y') }} |
description No invoices | |||||
| Name | Base URL | Status | Capabilities | Weight |
|---|---|---|---|---|
| {{ $n->name }} | {{ $n->base_url }} | {{ $n->status }} | {{ implode(', ',$n->capabilities??[]) }} | {{ $n->weight ?? 1 }} |
hub No gateway nodes | ||||
| Action | Actor | Tenant | IP | Time |
|---|---|---|---|---|
|
{{ $log->action ?? '—' }}
@if($log->description){{ Str::limit($log->description,80) }} @endif
|
{{ $log->actor_email ?? $log->user_id ?? '—' }} | {{ $log->tenant?->name ?? '—' }} | {{ $log->ip_address ?? '—' }} | {{ $log->created_at?->format('d M H:i') }} |
history No audit logs | ||||
Module code: {{ $module->code }}
Full CRUD for this module will be implemented in the next phase.