Fix last packet transfers shown, added file transfers

This commit is contained in:
2023-07-19 15:16:25 +10:00
parent f4fc6c24a4
commit 39605af693
8 changed files with 249 additions and 37 deletions

View File

@@ -417,8 +417,10 @@
<div class="col-4">
The last Netmails sent (to you):
@if(($x=\App\Models\Netmail::whereIn('sent_id',$o->addresses->pluck('id'))
@if(($x=\App\Models\Netmail::select(['sent_pkt','sent_at',DB::raw('count(*) AS count')])
->whereIn('sent_id',$o->addresses->pluck('id'))
->whereNotNull('sent_at')
->groupBy(['sent_pkt','sent_at'])
->orderBy('sent_at','DESC')
->limit(10)
->get())->count())
@@ -427,17 +429,17 @@
<thead>
<tr>
<th>Packet</th>
<th>Count</th>
<th>Sent</th>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('sent_pkt') as $oo)
@foreach ($x as $oo)
<tr>
<td class="packet">{{ $oo->first()->sent_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->sent_at }}</td>
<td class="packet">{{ $oo->sent_pkt }}</td>
<td>{{ $oo->sent_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
@@ -450,29 +452,62 @@
<div class="col-4">
The last Echomails sent (to you):
@if(($x=\App\Models\Echomail::select(['echomails.id','echomail_seenby.sent_pkt','echomail_seenby.sent_at'])
@if(($x=\App\Models\Echomail::select(['sent_pkt','sent_at',DB::raw('count(*) AS count')])
->join('echomail_seenby',['echomail_seenby.echomail_id'=>'echomails.id'])
->whereNotNull('echomail_seenby.sent_at')
->whereNotNull('sent_at')
->whereIn('address_id',$o->addresses->pluck('id'))
->groupBy(['sent_pkt','sent_at'])
->orderBy('sent_at','DESC')
->orderBy('sent_pkt')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<th>Packet</th>
<th>Count</th>
<th>Sent</th>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('sent_pkt') as $oo)
@foreach ($x as $oo)
<tr>
<td class="packet">{{ $oo->first()->sent_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->sent_at }}</td>
<td class="packet">{{ $oo->sent_pkt }}</td>
<td>{{ $oo->sent_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
<div class="col-4">
The last Files sent (to you):
@if(($x=\App\Models\File::select(['sent_at',DB::raw('count(*) AS count')])
->join('file_seenby',['file_seenby.file_id'=>'files.id'])
->whereNotNull('sent_at')
->whereIn('address_id',$o->addresses->pluck('id'))
->groupBy(['sent_at'])
->orderBy('sent_at','DESC')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<th>Session</th>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x as $oo)
<tr>
<td class="files">{{ $oo->sent_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
@@ -487,9 +522,10 @@
<div class="col-4">
The last Netmails received (you sent):
@if(($x=\App\Models\Netmail::select(['netmails.*','netmail_path.recv_pkt'])
@if(($x=\App\Models\Netmail::select(['recv_pkt','created_at',DB::raw('count(*) AS count')])
->join('netmail_path',['netmail_path.netmail_id'=>'netmails.id'])
->whereIn('address_id',$o->addresses->pluck('id'))
->groupBy(['recv_pkt','created_at'])
->orderBy('created_at','DESC')
->limit(10)
->get())->count())
@@ -497,17 +533,17 @@
<thead>
<tr>
<th>Packet</th>
<th>Count</th>
<th>Received</th>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('recv_pkt') as $oo)
@foreach ($x as $oo)
<tr>
<td class="packet">{{ $oo->first()->recv_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->created_at }}</td>
<td class="packet">{{ $oo->recv_pkt }}</td>
<td>{{ $oo->created_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
@@ -520,29 +556,60 @@
<div class="col-4">
The last Echomails received (you sent):
@if(($x=\App\Models\Echomail::select(['echomails.created_at','echomail_path.recv_pkt'])
@if(($x=\App\Models\Echomail::select(['recv_pkt','created_at',DB::raw('count(*) AS count')])
->join('echomail_path',['echomail_path.echomail_id'=>'echomails.id'])
->whereNotNull('echomail_path.recv_pkt')
->whereNotNull('recv_pkt')
->whereIn('address_id',$o->addresses->pluck('id'))
->groupBy(['recv_pkt','created_at'])
->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>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x->groupBy('recv_pkt') as $oo)
@foreach ($x as $oo)
<tr>
<td class="packet">{{ $oo->first()->recv_pkt }}</td>
<td>{{ $oo->count() }}</td>
<td>{{ $oo->first()->created_at }}</td>
<td class="packet">{{ $oo->recv_pkt }}</td>
<td>{{ $oo->created_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<strong class="highlight">None</strong>
@endif
</div>
<div class="col-4">
The last Files received (from you):
@if(($x=\App\Models\File::select(['created_at',DB::raw('count(*) AS count')])
->whereIn('fftn_id',$o->addresses->pluck('id'))
->groupBy(['created_at'])
->orderBy('created_at','DESC')
->limit(10)
->get())->count())
<table class="table monotable">
<thead>
<tr>
<th>Session</th>
<th class="text-end">Count</th>
</tr>
</thead>
<tbody>
@foreach ($x as $oo)
<tr>
<td class="files">{{ $oo->created_at }}</td>
<td class="text-end">{{ $oo->count }}</td>
</tr>
@endforeach
</tbody>
@@ -562,6 +629,7 @@
</div>
@include('widgets.modal_packet')
@include('widgets.modal_files')
@include('widgets.modal_purge')
@endsection