From 37549a90b7d55b0ec3144b27bad70f07058bd369 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 2 Dec 2024 19:57:39 +1100 Subject: [PATCH] Change rendering of user's home, taking into account systems that have been marked inactive --- app/Models/User.php | 1 + resources/views/dashboard.blade.php | 120 ++++++++++++++-------------- 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index f1fd1d6..8edccdb 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -81,6 +81,7 @@ class User extends Authenticatable implements MustVerifyEmail ->join('systems',['systems.id'=>'addresses.system_id']) ->join('system_user',['system_user.system_id'=>'systems.id']) ->where('system_user.user_id',$this->id) + ->where('systems.active',TRUE) ->ActiveFTN() ->FTN() ->get(); diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index b5a0b15..3c9d744 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -22,66 +22,67 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);
-

Hub Details for your nets

+ @if(($x=$user + ->addresses() + ->diff(our_address()) + ->filter(fn($item)=>($item->point_id === 0) && ($item->zone->domain->isManaged())))->count()) +

Hub Details for your nets

-
- @foreach($user - ->addresses() - ->diff(our_address()) - ->filter(fn($item)=>($item->point_id === 0) && ($item->zone->domain->isManaged())) - ->groupBy('zone.domain.name') as $list) - -
-

- $loop->index]) id="hd_{{ $x }}" data-bs-toggle="collapse" data-bs-target="#collapse_{{ $x }}" aria-expanded="true" aria-controls="collapse_{{ $x }}">{{ $x }} -

+
+ @foreach($x->groupBy('zone.domain.name') as $list) + +
+

+ $loop->index]) id="hd_{{ $x }}" data-bs-toggle="collapse" data-bs-target="#collapse_{{ $x }}" aria-expanded="true" aria-controls="collapse_{{ $x }}">{{ $x }} +

-
-
-

For your addresses in this domain: {!! $list->pluck('ftn')->join(', ') !!}, you'll need to use the following details:

-
- - - - - - - - - - - - - - - - - - - -
- Hub FTN Address - - {{ our_address($list->first())->ftn4d }} -
- Hub FTN Domain - - {{ $x }} -
- Hub Internet Address - - {{ our_hostname($list->first()) }} -
- Hub Internet Ports - - BINKP: {{ $setup->binkp_port }} MD5 Mode: {{$setup->optionGet(Binkp::F_MD,'binkp_options') ? 'YES' : 'NO' }}
- EMSI: {{ $setup->emsi_port }} Protocol: Zmodem
-
+
+
+

For your addresses in this domain: {!! $list->pluck('ftn')->join(', ') !!}, you'll need to use the following details:

+
+ + + + + + + + + + + + + + + + + + + +
+ Hub FTN Address + + {{ our_address($list->first())->ftn4d }} +
+ Hub FTN Domain + + {{ $x }} +
+ Hub Internet Address + + {{ our_hostname($list->first()) }} +
+ Hub Internet Ports + + BINKP: {{ $setup->binkp_port }} MD5 Mode: {{$setup->optionGet(Binkp::F_MD,'binkp_options') ? 'YES' : 'NO' }}
+ EMSI: {{ $setup->emsi_port }} Protocol: Zmodem
+
+
-
- @endforeach -
+ @endforeach +
+ @endif
@@ -119,8 +120,9 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);

Active and Available Echos

- @foreach (($dl=$user + @forelse(($dl=$user ->systems + ->where('active',TRUE) ->pluck('akas')->flatten() ->pluck('zone.domain') ->unique() @@ -137,7 +139,9 @@ $user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']); @endforeach - @endforeach + @empty +

We share no active FTN addresses, so there are no Echos available

+ @endforelse