Complete of logging received and sent packet names, and display them in the web ui for each node

This commit is contained in:
2023-07-15 22:10:05 +10:00
parent 61ab0614b6
commit a3302b4012
14 changed files with 257 additions and 121 deletions

View File

@@ -415,57 +415,141 @@
<div class="accordion-body">
<div class="row">
<div class="col-4">
The last Netmails sent:
<table class="table monotable">
<thead>
<tr>
<th>FTN</th>
<th>Packet</th>
<th>Sent</th>
</tr>
</thead>
The last Netmails sent (to you):
<tbody>
@dump($o->addresses->sortBy('zone.zone_id')->pluck('ftn'))
@foreach (\App\Models\Netmail::where('tftn_id',$o->addresses->pluck('id'))->whereNotNull('sent_at')->orderBy('sent_at')->limit(10) as $no)
@if(($x=\App\Models\Netmail::whereIn('sent_id',$o->addresses->pluck('id'))
->whereNotNull('sent_at')
->orderBy('sent_at','DESC')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<td>{{ $no->tftn->ftn }}</td>
<td></td>
<td></td>
<th>Packet</th>
<th>Count</th>
<th>Sent</th>
</tr>
@endforeach
</tbody>
</table>
</thead>
<tbody>
@foreach ($x->groupBy('sent_pkt') as $oo)
<tr>
<td>{{ $oo->first()->sent_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->sent_at }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
<div class="col-4">
The last Echomails sent:
<table class="table monotable">
<thead>
<tr>
<th>FTN</th>
<th>Packet</th>
<th>Sent</th>
</tr>
</thead>
The last Echomails sent (to you):
<tbody>
@foreach (\App\Models\Echomail::join('echomail_seenby',['echomail_seenby.echomail_id'=>'echomails.id'])
->whereNotNull('echomail_seenby.sent_at')
->whereIn('address_id',$o->addresses->pluck('id'))
->orderBy('sent_at','DESC')
->orderBy('packet')
->limit(10)
->get()
->groupBy('packet') as $oo)
@if(($x=\App\Models\Echomail::select(['echomails.id','echomail_seenby.sent_pkt','echomail_seenby.sent_at'])
->join('echomail_seenby',['echomail_seenby.echomail_id'=>'echomails.id'])
->whereNotNull('echomail_seenby.sent_at')
->whereIn('address_id',$o->addresses->pluck('id'))
->orderBy('sent_at','DESC')
->orderBy('sent_pkt')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<td>{{ \App\Models\Address::where('id',$oo->first()->address_id)->single()->ftn }}</td>
<td>{{ $oo->first()->packet }}</td>
<td>{{ $oo->first()->sent_at }}</td>
<th>Packet</th>
<th>Count</th>
<th>Sent</th>
</tr>
@endforeach
</tbody>
</table>
</thead>
<tbody>
@foreach ($x->groupBy('sent_pkt') as $oo)
<tr>
<td>{{ $oo->first()->sent_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->sent_at }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
</div>
<div class="row pt-2">
<div class="col-4">
The last Netmails received (you sent):
@if(($x=\App\Models\Netmail::select(['netmails.*','netmail_path.recv_pkt'])
->join('netmail_path',['netmail_path.netmail_id'=>'netmails.id'])
->whereIn('address_id',$o->addresses->pluck('id'))
->orderBy('created_at','DESC')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<th>Packet</th>
<th>Count</th>
<th>Received</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('recv_pkt') as $oo)
<tr>
<td>{{ $oo->first()->recv_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->created_at }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
<div class="col-4">
The last Echomails received (you sent):
@if(($x=\App\Models\Echomail::select(['echomails.created_at','echomail_path.recv_pkt'])
->join('echomail_path',['echomail_path.echomail_id'=>'echomails.id'])
->whereNotNull('echomail_path.recv_pkt')
->whereIn('address_id',$o->addresses->pluck('id'))
->orderBy('created_at','DESC')
->orderBy('recv_pkt')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<th>Packet</th>
<th>Count</th>
<th>Received</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('recv_pkt') as $oo)
<tr>
<td>{{ $oo->first()->recv_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->created_at }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
</div>
</div>

View File

@@ -1,6 +1,10 @@
@php
use App\Classes\FTN\Message;
@endphp
<div class="row">
<div class="col-4">
TO: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->to) !!}</strong> @if ($msg instanceof \App\Models\Netmail)(<strong class="highlight">{{ $msg->tftn->ftn }}</strong>)@endif
TO: <strong class="highlight">{!! Message::tr($msg->to) !!}</strong> @if ($msg instanceof \App\Models\Netmail)(<strong class="highlight">{{ $msg->tftn->ftn }}</strong>)@endif
</div>
<div class="col-4">
DATE: <strong class="highlight">{{ $msg->datetime->format('Y-m-d H:i:s') }}</strong>
@@ -9,7 +13,7 @@
<div class="row pt-1">
<div class="col-4">
FROM: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->from) !!}</strong> (<strong class="highlight">{{ $msg->fftn->ftn }}</strong>)
FROM: <strong class="highlight">{!! Message::tr($msg->from) !!}</strong> (<strong class="highlight">{{ $msg->fftn->ftn }}</strong>)
</div>
<div class="col-4">
MSGID: <strong class="highlight">{{ $msg->msgid }}</strong>@if($x=\App\Models\Echomail::where('replyid',$msg->msgid)->count()) (<strong class="highlight">{{$x}}</strong> replies)@endif @if($msg->replyid)<br>REPLY: <strong class="highlight">{{ $msg->replyid }}</strong>@endif
@@ -18,7 +22,7 @@
<div class="row pt-1 pb-2">
<div class="col-4">
SUBJECT: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->subject) !!}</strong>
SUBJECT: <strong class="highlight">{!! Message::tr($msg->subject) !!}</strong>
</div>
@if ($msg instanceof \App\Models\Echomail)
<div class="col-4">
@@ -30,7 +34,7 @@
<div class="row pb-2">
<div class="col-8">
<div class="pad pb-0">
<pre class="highlight">{!! \App\Classes\FTN\Message::tr($msg->msg).($msg->origin ? sprintf("\r * Origin: %s",$msg->origin) : '') !!}</pre>
<pre class="highlight">{!! Message::tr($msg->msg).($msg->origin ? sprintf("\r * Origin: %s",$msg->origin) : '') !!}</pre>
</div>
</div>
</div>
@@ -43,26 +47,29 @@
</div>
@endif
@if ($msg->flags & \App\Classes\FTN\Message::FLAG_LOCAL)
@if ($msg->flags & Message::FLAG_LOCAL)
<div class="row pb-2">
<div class="col-8">
<strong class="highlight">Local message</strong>
</div>
</div>
@elseif ($msg->flags & (\App\Classes\FTN\Message::FLAG_INTRANSIT|\App\Classes\FTN\Message::FLAG_RECD))
@elseif ((! $msg->flags) || ($msg->flags & (Message::FLAG_INTRANSIT|Message::FLAG_RECD)))
<!-- @todo for the nodes we export to, highlight those that we have actually sent it, vs those that havent received it yet -->
<div class="row pb-2">
<div class="col-8">
PATH: <br><strong class="highlight">{!! optimize_path($msg->pathorder())->join('</strong> -> <strong class="highlight">') !!}</strong>
</div>
</div>
<div class="row pb-2">
<div class="col-8">
RECEIVED:
@foreach ($msg->received as $path)
<strong class="highlight">{{ $path->pivot->recv_pkt }}</strong> by <strong class="highlight">{{ $path->ftn }}</strong> {{ $msg->created_at }}
@endforeach
@if ($msg->flags)
<div class="row pb-2">
<div class="col-8">
RECEIVED:
@foreach ($msg->received as $path)
<strong class="highlight">{{ $path->pivot->recv_pkt }}</strong> by <strong class="highlight">{{ $path->ftn }}</strong> {{ $msg->created_at }}
@endforeach
</div>
</div>
</div>
@endif
@endif