mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 04:40:08 +00:00
Bug: fix packet loss rounding in notifications (#2670)
This commit is contained in:
@@ -72,7 +72,7 @@ class ProcessCompletedSpeedtest
|
|||||||
'ping' => round($result->ping).' ms',
|
'ping' => round($result->ping).' ms',
|
||||||
'download' => Number::toBitRate(bits: $result->download_bits, precision: 2),
|
'download' => Number::toBitRate(bits: $result->download_bits, precision: 2),
|
||||||
'upload' => Number::toBitRate(bits: $result->upload_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,
|
'speedtest_url' => $result->result_url,
|
||||||
'url' => url('/admin/results'),
|
'url' => url('/admin/results'),
|
||||||
])->render();
|
])->render();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class CompletedSpeedtestMail extends Mailable implements ShouldQueue
|
|||||||
'ping' => round($this->result->ping, 2).' ms',
|
'ping' => round($this->result->ping, 2).' ms',
|
||||||
'download' => Number::toBitRate(bits: $this->result->download_bits, precision: 2),
|
'download' => Number::toBitRate(bits: $this->result->download_bits, precision: 2),
|
||||||
'upload' => Number::toBitRate(bits: $this->result->upload_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,
|
'speedtest_url' => $this->result->result_url,
|
||||||
'url' => url('/admin/results'),
|
'url' => url('/admin/results'),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ A new speedtest on **{{ config('app.name') }}** was completed using **{{ $servic
|
|||||||
- **Ping:** {{ $ping }}
|
- **Ping:** {{ $ping }}
|
||||||
- **Download:** {{ $download }}
|
- **Download:** {{ $download }}
|
||||||
- **Upload:** {{ $upload }}
|
- **Upload:** {{ $upload }}
|
||||||
|
@filled($packetLoss)
|
||||||
- **Packet Loss:** {{ $packetLoss }}%
|
- **Packet Loss:** {{ $packetLoss }}%
|
||||||
|
@endfilled
|
||||||
|
|
||||||
### Links
|
### Links
|
||||||
- [View Ookla Results]({{ $speedtest_url }})
|
- [View Ookla Results]({{ $speedtest_url }})
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ A new speedtest was completed using **{{ $service }}**.
|
|||||||
| Ping | {{ $ping }} |
|
| Ping | {{ $ping }} |
|
||||||
| Download | {{ $download }} |
|
| Download | {{ $download }} |
|
||||||
| Upload | {{ $upload }} |
|
| Upload | {{ $upload }} |
|
||||||
|
@filled($packetLoss)
|
||||||
| Packet Loss | {{ $packetLoss }} **%** |
|
| Packet Loss | {{ $packetLoss }} **%** |
|
||||||
|
@endfilled
|
||||||
|
|
||||||
|
|
||||||
</x-mail::table>
|
</x-mail::table>
|
||||||
|
|||||||
Reference in New Issue
Block a user