|
2 | 2 |
|
3 | 3 | namespace App\Actions\Notifications; |
4 | 4 |
|
| 5 | +use App\Helpers\Number; |
5 | 6 | use App\Models\Result; |
6 | 7 | use App\Services\SpeedtestFakeResultGenerator; |
7 | 8 | use Filament\Notifications\Notification; |
@@ -33,10 +34,12 @@ public function handle(array $webhooks) |
33 | 34 | ->payload([ |
34 | 35 | 'result_id' => Str::uuid(), |
35 | 36 | 'site_name' => __('settings/notifications.test_notifications.webhook.payload'), |
| 37 | + 'server_name' => $fakeResult->data['server']['name'], |
| 38 | + 'server_id' => $fakeResult->data['server']['id'], |
36 | 39 | 'isp' => $fakeResult->data['isp'], |
37 | | - 'ping' => $fakeResult->ping, |
38 | | - 'download' => $fakeResult->download, |
39 | | - 'upload' => $fakeResult->upload, |
| 40 | + 'ping' => round($fakeResult->ping), |
| 41 | + 'download' => Number::bitsToMagnitude(bits: $fakeResult->upload, precision: 0, magnitude: 'mbit'), |
| 42 | + 'upload' => Number::bitsToMagnitude(bits: $fakeResult->download, precision: 0, magnitude: 'mbit'), |
40 | 43 | 'packet_loss' => $fakeResult->data['packetLoss'], |
41 | 44 | 'speedtest_url' => $fakeResult->data['result']['url'], |
42 | 45 | 'url' => url('/admin/results'), |
|
0 commit comments