diff --git a/app/Models/Domain.php b/app/Models/Domain.php index 19d3334..1c2cb1a 100644 --- a/app/Models/Domain.php +++ b/app/Models/Domain.php @@ -122,20 +122,17 @@ class Domain extends Model }); } - public function isManaged(): bool - { - return our_address()->pluck('zone.domain')->pluck('id')->contains($this->id); - } - /** * Determine if this zone is managed by this host * * @return bool - * @deprecated use self::isManaged(); + * @throws \Exception */ - public function managed(): bool + public function isManaged(): bool { - return our_address($this)->count() > 0; + $x = our_address(); + + return $x && $x->pluck('zone.domain')->pluck('id')->contains($this->id); } /** diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index e2f4b48..46b2bdc 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -178,7 +178,7 @@ ->orderBy('name') ->with(['echoareas']) ->get() as $o) - @if ($o->managed()) + @if ($o->isManaged()) { name: '{{ $o->name }}', data: [], diff --git a/resources/views/domain/addedit.blade.php b/resources/views/domain/addedit.blade.php index 3478c0e..a51b9ee 100644 --- a/resources/views/domain/addedit.blade.php +++ b/resources/views/domain/addedit.blade.php @@ -1,3 +1,4 @@ + @extends('layouts.app') @section('htmlheader_title') @@ -62,7 +63,7 @@ use App\Models\Echoarea;
- @if ($o->managed()) + @if ($o->isManaged()) @if ($o->nodelist_filename)
diff --git a/resources/views/domain/list.blade.php b/resources/views/domain/list.blade.php index 9cd86d0..de08637 100644 --- a/resources/views/domain/list.blade.php +++ b/resources/views/domain/list.blade.php @@ -3,6 +3,10 @@ Known FTN Networks @endsection +@php +use App\Models\Domain; +@endphp + @section('content')
@@ -22,7 +26,7 @@ - @foreach (\App\Models\Domain::public()->orderBy('name')->with(['zones.addresses.system'])->get() as $do) + @foreach (Domain::public()->orderBy('name')->with(['zones.addresses.system'])->get() as $do) @if($do->active) @@ -33,7 +37,7 @@ {{ $do->zones->where('active',TRUE)->pluck('zone_id')->sort()->join(', ') }} {{ $do->active ? 'Active' : 'Not Active' }} - {{ $do->managed() ? 'YES' : 'NO' }} + {{ $do->isManaged() ? 'YES' : 'NO' }} @foreach (($x=$do->zones->pluck('addresses')->flatten())->where('role',\App\Models\Address::NODE_ZC)->sortBy('zone.zone_id') as $ao) {{ $ao->system->sysop }}, {{ $ao->system->name }}