Show users hub connection details for their domains
This commit is contained in:
@@ -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)
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user