Remove deprecated Domain::managed()
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m49s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
Deon George 2024-05-29 19:13:28 +10:00
parent 195d88b84d
commit d53ca09c0c
4 changed files with 15 additions and 12 deletions

View File

@ -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);
}
/**

View File

@ -178,7 +178,7 @@
->orderBy('name')
->with(['echoareas'])
->get() as $o)
@if ($o->managed())
@if ($o->isManaged())
{
name: '{{ $o->name }}',
data: [],

View File

@ -1,3 +1,4 @@
<!-- $o=Domain::class -->
@extends('layouts.app')
@section('htmlheader_title')
@ -62,7 +63,7 @@ use App\Models\Echoarea;
</div>
<div class="col-4">
@if ($o->managed())
@if ($o->isManaged())
@if ($o->nodelist_filename)
<label for="nodelist_filename" class="form-label">Nodelist File</label>
<div class="input-group">

View File

@ -3,6 +3,10 @@
Known FTN Networks
@endsection
@php
use App\Models\Domain;
@endphp
@section('content')
<div class="row">
<div class="col-12">
@ -22,7 +26,7 @@
</tr>
</thead>
<tbody>
@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)
<tr>
<td>
@if($do->active)
@ -33,7 +37,7 @@
</td>
<td>{{ $do->zones->where('active',TRUE)->pluck('zone_id')->sort()->join(', ') }}</td>
<td class="text-end">{{ $do->active ? 'Active' : 'Not Active' }}</td>
<td class="text-end">{{ $do->managed() ? 'YES' : 'NO' }}</td>
<td class="text-end">{{ $do->isManaged() ? 'YES' : 'NO' }}</td>
<td>
@foreach (($x=$do->zones->pluck('addresses')->flatten())->where('role',\App\Models\Address::NODE_ZC)->sortBy('zone.zone_id') as $ao)
{{ $ao->system->sysop }}, <a href="{{ url('system/view',$ao->system_id) }}">{{ $ao->system->name }}</a><br>