Skip to content

Commit 1ada95c

Browse files
bug: add server name and id to test wehbook (#2676)
Co-authored-by: Alex Justesen <[email protected]>
1 parent edff468 commit 1ada95c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/Actions/Notifications/SendWebhookTestNotification.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Actions\Notifications;
44

5+
use App\Helpers\Number;
56
use App\Models\Result;
67
use App\Services\SpeedtestFakeResultGenerator;
78
use Filament\Notifications\Notification;
@@ -33,10 +34,12 @@ public function handle(array $webhooks)
3334
->payload([
3435
'result_id' => Str::uuid(),
3536
'site_name' => __('settings/notifications.test_notifications.webhook.payload'),
37+
'server_name' => $fakeResult->data['server']['name'],
38+
'server_id' => $fakeResult->data['server']['id'],
3639
'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'),
4043
'packet_loss' => $fakeResult->data['packetLoss'],
4144
'speedtest_url' => $fakeResult->data['result']['url'],
4245
'url' => url('/admin/results'),

0 commit comments

Comments
 (0)