@trans_db('my_dns_zones', 'dns_zones', 'My DNS Zones')

{{ __('menu.dashboard') }} / @trans_db('my_dns_zones', 'dns_zones', 'DNS Zones')

@if(Auth::user()->canPerformDnsOperations()) @trans_db('add_dns_zone', 'dns_zones', 'Add DNS Zone') @else @endif

@trans_db('current_plan', 'dashboard', 'Plan Curent')

@if(Auth::user()->role === 'admin') @trans_db('administrator', 'dashboard', 'Administrator') @elseif(Auth::user()->role === 'reseller') {{ Auth::user()->resellerPlan?->name ?? 'Reseller' }} @else {{ Auth::user()->plan?->name ?? trans_db('free', 'dashboard', 'Gratuit') }} @endif

@if(Auth::user()->plan_expires_at && Auth::user()->role !== 'admin')

@trans_db('expires', 'dashboard', 'Expiră'): {{ Auth::user()->plan_expires_at->format('d M Y') }}

@else

@trans_db('no_expiry', 'dashboard', 'Fără dată expirare')

@endif

@trans_db('zone_dns', 'dns_zones', 'Zone DNS')

@if(Auth::user()->role === 'admin') {{ $zones->total() }} / ∞ @elseif(Auth::user()->role === 'reseller') {{ $zones->total() }} / {{ Auth::user()->resellerPlan?->dns_zones_per_client ?? 'N/A' }} @else {{ $zones->total() }} / {{ Auth::user()->plan?->dns_zones_limit ?? 0 }} @endif

@if(Auth::user()->role !== 'admin')
@php $zonesCount = $zones->total(); if(Auth::user()->role === 'reseller') { $zonesLimit = Auth::user()->resellerPlan?->dns_zones_per_client ?? 1; } else { $zonesLimit = Auth::user()->plan?->dns_zones_limit ?? 1; } $zonesPercent = $zonesLimit > 0 ? min(($zonesCount / $zonesLimit) * 100, 100) : 0; @endphp
@else

Unlimited

@endif

Înregistrări DNS

@php $recordsCount = Auth::user()->getTotalRecordsCount(); @endphp @if(Auth::user()->role === 'admin') {{ $recordsCount }} / ∞ @elseif(Auth::user()->role === 'reseller') {{ $recordsCount }} / {{ Auth::user()->resellerPlan?->subdomains_per_client ?? 'N/A' }} @else {{ $recordsCount }} / {{ Auth::user()->plan?->subdomains_limit ?? 0 }} @endif

@if(Auth::user()->role !== 'admin')
@php if(Auth::user()->role === 'reseller') { $recordsLimit = Auth::user()->resellerPlan?->subdomains_per_client ?? 1; } else { $recordsLimit = Auth::user()->plan?->subdomains_limit ?? 1; } $recordsPercent = $recordsLimit > 0 ? min(($recordsCount / $recordsLimit) * 100, 100) : 0; @endphp
@else

Unlimited

@endif
@php $user = Auth::user(); $nameserversList = []; if ($user->isAdmin()) { // Admin vede toate nameserverele active $nameserversList = \App\Models\Nameserver::active()->pluck('hostname')->toArray(); } elseif ($user->role === 'reseller' && $user->resellerPlan) { // Reseller vede nameserverele din planul său reseller $allowedIds = $user->resellerPlan->getAllowedNameServers(); $nameserversList = \App\Models\Nameserver::whereIn('id', $allowedIds) ->where('is_active', true) ->pluck('hostname') ->toArray(); } elseif ($user->reseller_id && $user->reseller && $user->reseller->resellerPlan) { // Client al unui reseller - vede nameserverele din planul resellerului $allowedIds = $user->reseller->resellerPlan->getAllowedNameServers(); $nameserversList = \App\Models\Nameserver::whereIn('id', $allowedIds) ->where('is_active', true) ->pluck('hostname') ->toArray(); } elseif ($user->plan) { // Client normal cu plan propriu $allowedIds = $user->plan->getAllowedNameServers(); $nameserversList = \App\Models\Nameserver::whereIn('id', $allowedIds) ->where('is_active', true) ->pluck('hostname') ->toArray(); } $totalNS = count($nameserversList); @endphp

NSuri Alocate

@if($totalNS > 2)
@foreach(array_chunk($nameserversList, 2) as $index => $chunk)
@endforeach
@endif
@if($totalNS > 0)
@foreach(array_chunk($nameserversList, 2) as $chunkIndex => $chunk)
@foreach($chunk as $hostname)

{{ $hostname }}

@endforeach
@endforeach
@else

Nu există nameservere alocate

@endif

Zone DNS

@if(request('search')) @endif
@if(request('status') || request('dnssec') || request('period') || request('sort') != 'newest') Resetează filtrele @endif
@if(request('status') || request('dnssec') || request('period'))
@if(request('status')) Status: {{ request('status') == 'active' ? 'Activ' : (request('status') == 'inactive' ? 'Inactiv' : 'Suspendat') }} × @endif @if(request('dnssec')) DNSSEC: {{ request('dnssec') == 'enabled' ? 'Activat' : 'Dezactivat' }} × @endif @if(request('period')) @php $periodLabels = ['today' => 'Azi', 'week' => 'Ultima săptămână', 'month' => 'Ultima lună', 'quarter' => 'Ultimele 3 luni', 'year' => 'Ultimul an']; @endphp Perioadă: {{ $periodLabels[request('period')] ?? request('period') }} × @endif
@endif
@if($zones->count() > 0)
@foreach($zones as $zone) @php $isPowerDnsOnly = isset($zone->is_powerdns_only) && $zone->is_powerdns_only; $zoneId = $isPowerDnsOnly ? null : $zone->id; @endphp @endforeach
DOMENIU STATUS ACȚIUNI
@if(!$isPowerDnsOnly) @else @endif
@php $recordCount = $isPowerDnsOnly ? count($zone->powerdns_data['rrsets'] ?? []) : $zone->records()->count(); @endphp {{ $recordCount }} {{ $recordCount === 1 ? 'înregistrare' : 'înregistrări' }} @if(Auth::user()->role === 'admin') · {{ $zone->user->name }} @endif
@if(!$isPowerDnsOnly) {{-- Pentru primele 2 rânduri, tooltip-ul apare jos; pentru restul, sus --}} @if($loop->index < 2) @else @endif @endif
@if($zone->is_active) Activ @else Inactiv @endif @if(!$isPowerDnsOnly && $zone->sync_to_powerdns && $zone->powerdns_zone_id) @php // Verifică numărul de nameservere active care au zona $syncedNsCount = \App\Models\NameServer::where('is_active', true) ->where('status', 'online') ->count(); @endphp Sync ({{ $syncedNsCount }}NS) @elseif(!$isPowerDnsOnly && !$zone->sync_to_powerdns) Local @elseif(!$isPowerDnsOnly && !$zone->powerdns_zone_id) Nu e sync @endif
@if(isset($zone->is_powerdns_only) && $zone->is_powerdns_only) {{-- PowerDNS only zone actions --}} @if(in_array($zone->powerdns_assignment->access_level, ['full', 'records_only'])) @endif @else {{-- Standard local zone actions --}} @if(auth()->user()->isAdmin()) @else @endif @if($zone->nameServer) @endif
@csrf @method('DELETE')
@endif
@foreach($zones as $zone) @php $isPowerDnsOnly = isset($zone->is_powerdns_only) && $zone->is_powerdns_only; $recordCount = $isPowerDnsOnly ? count($zone->powerdns_data['rrsets'] ?? []) : $zone->records()->count(); // Get nameservers for copy $nsUser = $zone->user; if ($nsUser->isAdmin()) { $nsAllowedIds = \App\Models\NameServer::where('is_active', true)->pluck('id')->toArray(); } else { $nsPlan = $nsUser->plan ?? $nsUser->resellerPlan; $nsAllowedIds = $nsPlan ? $nsPlan->allowed_nameservers : []; } $cardNameservers = []; if (!empty($nsAllowedIds)) { $nsModels = \App\Models\NameServer::whereIn('id', $nsAllowedIds)->get(); foreach ($nsModels as $ns) { $cardNameservers[] = $ns->hostname; } } @endphp
@if(!$isPowerDnsOnly) @endif
{{ $zone->domain }} @if(Auth::user()->role === 'admin')

{{ $zone->user->name }}

@endif
{{ $zone->is_active ? 'Activ' : 'Inactiv' }}
{{ $recordCount }} înregistrări
{{ $zone->created_at->format('d.m.Y') }}
DNSSEC {{ $zone->dnssec_enabled ? 'Activ' : 'Inactiv' }}
@if(!$isPowerDnsOnly && $zone->sync_to_powerdns && $zone->powerdns_zone_id)
Sincronizat
@elseif(!$isPowerDnsOnly && !$zone->sync_to_powerdns)
Local
@endif
@if(count($cardNameservers) > 0)
Nameservere:
@foreach(array_slice($cardNameservers, 0, 2) as $ns) {{ $ns }} @endforeach @if(count($cardNameservers) > 2) +{{ count($cardNameservers) - 2 }} @endif
@endif
Vezi @if(!$isPowerDnsOnly) Editează @endif
@if(!$isPowerDnsOnly)
@endif
@endforeach
{{ $zones->links() }}
@else

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

Încă nu ai nicio zonă DNS. Creează prima ta zonă DNS acum!

@if(Auth::user()->canPerformDnsOperations()) {{ __('Add DNS Zone') }} @else @endif
@endif