Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/inactivity-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Lock Inactive Issues
runs-on: ubuntu-24.04
steps:
- uses: klaasnicolaas/action-inactivity-lock@v1.1.3
- uses: klaasnicolaas/action-inactivity-lock@v2.0.1
id: lock
with:
days-inactive-issues: 14
Expand Down
11 changes: 7 additions & 4 deletions app/Actions/Notifications/SendWebhookTestNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Actions\Notifications;

use App\Helpers\Number;
use App\Models\Result;
use App\Services\SpeedtestFakeResultGenerator;
use Filament\Notifications\Notification;
Expand Down Expand Up @@ -33,16 +34,18 @@ public function handle(array $webhooks)
->payload([
'result_id' => Str::uuid(),
'site_name' => __('settings/notifications.test_notifications.webhook.payload'),
'server_name' => $fakeResult->data['server']['name'],
'server_id' => $fakeResult->data['server']['id'],
'isp' => $fakeResult->data['isp'],
'ping' => $fakeResult->ping,
'download' => $fakeResult->download,
'upload' => $fakeResult->upload,
'ping' => round($fakeResult->ping),
'download' => Number::bitsToMagnitude(bits: $fakeResult->upload, precision: 0, magnitude: 'mbit'),
'upload' => Number::bitsToMagnitude(bits: $fakeResult->download, precision: 0, magnitude: 'mbit'),
'packet_loss' => $fakeResult->data['packetLoss'],
'speedtest_url' => $fakeResult->data['result']['url'],
'url' => url('/admin/results'),
])
->doNotSign()
->dispatch();
->dispatchSync();
}

Notification::make()
Expand Down
6 changes: 3 additions & 3 deletions app/Filament/Widgets/Concerns/HasChartFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ trait HasChartFilters
protected function getFilters(): ?array
{
return [
'24h' => 'Last 24 hours',
'week' => 'Last 7 days',
'month' => 'Last 30 days',
'24h' => __('general.last_24h'),
'week' => __('general.last_week'),
'month' => __('general.last_month'),
];
}
}
21 changes: 21 additions & 0 deletions app/Listeners/LogWebhookFailure.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Listeners;

use Illuminate\Support\Facades\Log;
use Spatie\WebhookServer\Events\WebhookCallFailedEvent;

class LogWebhookFailure
{
/**
* Handle the event.
*/
public function handle(WebhookCallFailedEvent $event): void
{
Log::error('Webhook notification failed', [
'url' => $event->webhookUrl,
'error_type' => $event->errorType,
'error_message' => $event->errorMessage,
]);
}
}
2 changes: 1 addition & 1 deletion app/Listeners/ProcessCompletedSpeedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function notifyAppriseChannels(Result $result): void
'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();
Expand Down
2 changes: 1 addition & 1 deletion app/Mail/CompletedSpeedtestMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function content(): Content
'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'),
],
Expand Down
7 changes: 6 additions & 1 deletion app/Notifications/AppriseChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public function send(object $notifiable, Notification $notification): void
return;
}

Log::debug('Attempting to send Apprise notification', [
'channel' => $message->urls,
'instance' => $appriseUrl,
]);

try {
$request = Http::timeout(30)
->withHeaders([
Expand All @@ -57,7 +62,7 @@ public function send(object $notifiable, Notification $notification): void
throw new Exception('Apprise returned an error, please check Apprise logs for details');
}

Log::info('Apprise notification sent', [
Log::debug('Apprise notification sent', [
'channel' => $message->urls,
'instance' => $appriseUrl,
]);
Expand Down
2 changes: 2 additions & 0 deletions lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
'settings' => 'Settings',
'users' => 'Users',
'documentation' => 'Documentation',
'documentation_description' => 'Need help getting started or configuring your speedtests?',
'view_documentation' => 'View documentation',
'links' => 'Links',
'donate' => 'Donate',
'donations' => 'Donations',
'donations_description' => 'Support the development and maintenance of Speedtest Tracker by making a donation.',

// Roles
'admin' => 'Admin',
Expand Down
1 change: 1 addition & 0 deletions lang/en/settings/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
'webhook' => [
'add' => 'Add webhook URLs!',
'sent' => 'Test webhook notification sent.',
'failed' => 'Webhook notification failed.',
'payload' => 'Testing webhook notification',
],
],
Expand Down
2 changes: 2 additions & 0 deletions resources/views/apprise/speedtest-completed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
- **Ping:** {{ $ping }}
- **Download:** {{ $download }}
- **Upload:** {{ $upload }}
@filled($packetLoss)
- **Packet Loss:** {{ $packetLoss }}%
@endfilled

### Links
- [View Ookla Results]({{ $speedtest_url }})
Expand Down
4 changes: 2 additions & 2 deletions resources/views/filament/pages/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class="col-span-1"
</x-slot>

<div class="text-sm text-zinc-600 dark:text-zinc-300">
<p>Need help getting started or configuring your speedtests?</p>
<p>{{ __('general.documentation_description') }}</p>
</div>

<div class="mt-5">
Expand All @@ -45,7 +45,7 @@ class="col-span-1"
</x-slot>

<div class="text-sm text-zinc-600 dark:text-zinc-300">
<p>Support the development and maintenance of Speedtest Tracker by making a donation.</p>
<p>{{ __('general.donations_description') }}</p>
</div>

<div class="mt-5">
Expand Down
2 changes: 2 additions & 0 deletions resources/views/mail/speedtest/completed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
| Ping | {{ $ping }} |
| Download | {{ $download }} |
| Upload | {{ $upload }} |
@filled($packetLoss)
| Packet Loss | {{ $packetLoss }} **%** |
@endfilled


</x-mail::table>
Expand Down