Show users hub connection details for their domains
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 36s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m43s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-05-24 11:04:25 +10:00
parent a687b5fd1c
commit 86c27a3f17
4 changed files with 117 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Gate;
use App\Classes\File;
use App\Classes\FTN\{Message,Packet};
use App\Classes\FTN\Packet;
use App\Http\Requests\SetupRequest;
use App\Models\File as FileModel;
use App\Models\{Address,Echomail,Netmail,Setup,System};
@@ -235,6 +235,12 @@ class HomeController extends Controller
->with('o',$o);
}
/**
* Return a list of unsent items
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Foundation\Application
* @see \App\Jobs\AddressIdle:class
*/
public function status()
{
$date = Carbon::now()->yesterday()->endOfday();
@@ -262,7 +268,7 @@ class HomeController extends Controller
->union(Address::UncollectedFilesTotal()
->where('files.created_at','<',$this->yesterdayEOD())
),'a')
->where('systems.active',true)
->where('systems.active',TRUE)
->where('addresses.active',TRUE)
->where('zones.active',TRUE)
->where('domains.active',TRUE)

View File

@@ -86,6 +86,7 @@ class User extends Authenticatable implements MustVerifyEmail
->where('zones.domain_id',$o->id);
})
->where('system_user.user_id',$this->id)
->activeFTN()
->with(['zone.domain'])
->get();
}

View File

@@ -131,6 +131,36 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
}
}
function our_hostname(Address $o): string
{
$our = our_address($o->domain)->first();
switch ($our->role_id) {
case Address::NODE_ZC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id));
break;
case Address::NODE_NC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id));
break;
case Address::NODE_HC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id))
->prepend(sprintf('f%d',$our->node_id));
break;
default:
$domain = collect(explode('.',gethostname()));
}
return $domain->join('.');
}
/**
* Return a list of nodes that collect mail directly from us
*