@extends('layouts.admin')
@section('content')
@php use App\Support\Ui; @endphp
{{-- Helper macros for the settings page (mockup fieldRow / toggle / select / masked input) --}}
@php
$fname = fn(string $key) => str_replace('.', '__', $key);
$row = function(string $label, string $desc, string $control) {
return '
'.e($label).'
'.($desc ? '
'.e($desc).'
' : '').'
'.$control.'
';
};
$toggle = function(string $key) use ($s, $fname) {
$on = $s->bool($key);
return '';
};
$select = function(string $key, array $options) use ($s, $fname) {
$cur = (string) $s->get($key);
$h = '';
};
$text = function(string $key, string $type = 'text') use ($s, $fname) {
return '';
};
$secret = function(string $key) use ($s, $fname) {
return '';
};
$conn = fn(bool $on, ?string $label = null) => ''.e($label ?? ($on ? 'Connected' : 'Not connected')).'';
$save = fn(string $panel) => '';
@endphp
@foreach($kpis as $k)@include('admin.partials.kpi', ['k' => $k])@endforeach
@foreach([['general','General','gear'],['payments','Payments','card'],['sms','SMS & Notifications','bolt'],['maps','Maps & Geolocation','globe'],['social','Social Login','users'],['security','Security','shield']] as [$id,$label,$ic])
@endforeach
{{-- GENERAL --}}
Hybrid storage — MariaDB ↔ JSON
Live sync status, queue depth and last reconciliation (Design Doc §4).
{!! $conn($status['database']['up'], $status['database']['up'] ? 'MariaDB online' : 'MariaDB offline') !!}
Mode
{{ $status['mode'] }}
Queued ops
{{ $status['queue']['depth'] }}
Last sync
{{ $status['queue']['last_sync_at'] ? date('H:i:s', $status['queue']['last_sync_at']) : '—' }}
Mirrored records
{{ number_format($status['json']['records']) }}
- Connection
- {{ $status['database']['connection'] }} · node {{ $status['node'] }}
- JSON path
- {{ $status['json']['path'] }} ({{ $status['json']['writable'] ? 'writable' : 'NOT WRITABLE' }})
- Outages
- {{ $status['database']['outages'] }} recorded{{ $status['database']['reason'] ? ' · last: '.\Illuminate\Support\Str::limit($status['database']['reason'], 80) : '' }}
- Last result
- {{ $status['queue']['last_sync_result'] ? json_encode(collect($status['queue']['last_sync_result'])->only(['status','applied','skipped','conflicts','failed','remaining'])) : '—' }}
@if($conflicts->count())
Conflicts awaiting review {{ $conflicts->count() }}
@foreach($conflicts as $c)
{{ $c->entity }} · {{ $c->record_id }} · {{ $c->kind }} · {{ Ui::ago($c->created_at) }}
{{ $c->note }}
Offline / JSON version
{{ json_encode($c->local_data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES) }}MariaDB version
{{ json_encode($c->db_data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES) }}
@endforeach
@endif
{{-- PAYMENTS --}}
{{-- SMS --}}
{{-- MAPS --}}
{{-- SOCIAL --}}
{{-- SECURITY --}}
@endsection