From 2590c2de71b8173ab7be1a143bfc010a3840e3b6 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 29 May 2024 19:13:28 +1000 Subject: [PATCH] Remove deprecated Domain::managed() --- app/Models/Domain.php | 14 ++++++-------- resources/views/about.blade.php | 2 +- resources/views/domain/addedit.blade.php | 3 ++- resources/views/domain/list.blade.php | 8 ++++++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/Models/Domain.php b/app/Models/Domain.php index 260a399..c7398a5 100644 --- a/app/Models/Domain.php +++ b/app/Models/Domain.php @@ -123,20 +123,18 @@ 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; + return ($x=our_address()) + && $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 }}