File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 44
55use App \Events \ResultCreated ;
66use App \Mail \SpeedtestCompletedMail ;
7+ use App \Settings \GeneralSettings ;
78use App \Settings \NotificationSettings ;
89use App \Telegram \TelegramNotification ;
910use Filament \Notifications \Notification ;
1011use Illuminate \Support \Facades \Mail ;
1112
1213class SpeedtestCompletedListener
1314{
15+ public $ generalSettings ;
16+
1417 public $ notificationSettings ;
1518
1619 /**
@@ -20,6 +23,8 @@ class SpeedtestCompletedListener
2023 */
2124 public function __construct ()
2225 {
26+ $ this ->generalSettings = new (GeneralSettings::class);
27+
2328 $ this ->notificationSettings = new (NotificationSettings::class);
2429 }
2530
@@ -59,6 +64,7 @@ public function handle(ResultCreated $event)
5964
6065 $ message = view ('telegram.speedtest-completed ' , [
6166 'id ' => $ event ->result ->id ,
67+ 'site_name ' => $ this ->generalSettings ->site_name ,
6268 'ping ' => $ ping_value ,
6369 'download ' => $ download_value ,
6470 'upload ' => $ upload_value ,
Original file line number Diff line number Diff line change 44
55use App \Events \ResultCreated ;
66use App \Mail \Threshold \AbsoluteMail ;
7+ use App \Settings \GeneralSettings ;
78use App \Settings \NotificationSettings ;
89use App \Settings \ThresholdSettings ;
910use App \Telegram \TelegramNotification ;
1415
1516class AbsoluteListener implements ShouldQueue
1617{
18+ public $ generalSettings ;
19+
1720 public $ notificationSettings ;
1821
1922 public $ thresholdSettings ;
@@ -25,6 +28,8 @@ class AbsoluteListener implements ShouldQueue
2528 */
2629 public function __construct ()
2730 {
31+ $ this ->generalSettings = new (GeneralSettings::class);
32+
2833 $ this ->notificationSettings = new (NotificationSettings::class);
2934
3035 $ this ->thresholdSettings = new (ThresholdSettings::class);
@@ -205,6 +210,7 @@ protected function telegramChannel(ResultCreated $event)
205210 $ message = view ('telegram.threshold.absolute ' , [
206211 'id ' => $ event ->result ->id ,
207212 'url ' => url ('/admin/results ' ),
213+ 'site_name ' => $ this ->generalSettings ->site_name ,
208214 'metrics ' => $ failedThresholds ,
209215 ])->render ();
210216
Original file line number Diff line number Diff line change 1- Speedtest #{{ $id } }
1+ {{ $site_name } } - Result *#{{ $id } } *
2+
3+ *Speedtest Completed*
4+ -----
25Ping: *{{ $ping } } *
36Download: *{{ $download } } *
47Upload: *{{ $upload } } *
Original file line number Diff line number Diff line change 1- Speedtest Result *#{{ $id } } *
2- *Absolute Threshold Failed*
1+ {{ $site_name } } - Result *#{{ $id } } *
2+
3+ *Absolute Threshold(s) Failed*
4+ -----
35@foreach ($metrics as $item )
4- Threshold *{{ $item [' name' ] } } * {{ $item [' threshold' ] } } : *{{ $item [' value' ] } } *
6+ Threshold *{{ $item [' name' ] } } * {{ $item [' threshold' ] } } : *{{ $item [' value' ] } } *
57@endforeach
You can’t perform that action at this time.
0 commit comments