Bug: fix packet loss rounding in notifications (#2670)

This commit is contained in:
Sven van Ginkel
2026-02-03 15:19:17 +01:00
committed by GitHub
parent d5ebe7ca57
commit edff46859c
4 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ class ProcessCompletedSpeedtest
'ping' => round($result->ping).' ms',
'download' => Number::toBitRate(bits: $result->download_bits, precision: 2),
'upload' => Number::toBitRate(bits: $result->upload_bits, precision: 2),
'packetLoss' => $result->packet_loss,
'packetLoss' => $result->packet_loss ? round($result->packet_loss, precision: 2) : '',
'speedtest_url' => $result->result_url,
'url' => url('/admin/results'),
])->render();
+1 -1
View File
@@ -51,7 +51,7 @@ class CompletedSpeedtestMail extends Mailable implements ShouldQueue
'ping' => round($this->result->ping, 2).' ms',
'download' => Number::toBitRate(bits: $this->result->download_bits, precision: 2),
'upload' => Number::toBitRate(bits: $this->result->upload_bits, precision: 2),
'packetLoss' => is_numeric($this->result->packet_loss) ? $this->result->packet_loss : 'n/a',
'packetLoss' => $result->packet_loss ? round($result->packet_loss, precision: 2) : '',
'speedtest_url' => $this->result->result_url,
'url' => url('/admin/results'),
],
@@ -6,7 +6,9 @@ A new speedtest on **{{ config('app.name') }}** was completed using **{{ $servic
- **Ping:** {{ $ping }}
- **Download:** {{ $download }}
- **Upload:** {{ $upload }}
@filled($packetLoss)
- **Packet Loss:** {{ $packetLoss }}%
@endfilled
### Links
- [View Ookla Results]({{ $speedtest_url }})
@@ -12,7 +12,9 @@ A new speedtest was completed using **{{ $service }}**.
| Ping | {{ $ping }} |
| Download | {{ $download }} |
| Upload | {{ $upload }} |
@filled($packetLoss)
| Packet Loss | {{ $packetLoss }} **%** |
@endfilled
</x-mail::table>