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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ body:
Please note:
- For **feature requests or changes**, use the [feature request form](https://github.com/alexjustesen/speedtest-tracker/issues/new?template=feature_request.yml).
- For **general questions**, **setup or configuration help**, or if you’re not sure this is a bug, please use **[GitHub Discussions](https://github.com/alexjustesen/speedtest-tracker/discussions)** instead.
- Any isseus with translations should be reported/solved within the [crowdin project](https://crowdin.com/project/speedtest-tracker).
- type: checkboxes
attributes:
label: Pre-work
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ body:
attributes:
value: |
You should only use this form to request a change or new feature, to report a bug or issue use the [bug report form](https://github.com/alexjustesen/speedtest-tracker).
Any reqeusts for new translations should be reqeusted within the [crowdin project](https://crowdin.com/project/speedtest-tracker).
- type: checkboxes
attributes:
label: Pre-work
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Speedtest Tracker is a self-hosted application that monitors the performance and
- **Detailed Metrics**: Capture download and upload speeds, ping, packet loss and more.
- **Historical Data**: View historical data and trends to identify patterns and issues with your internet connection.
- **Notifications**: Receive notifications when your internet performance drops below a certain threshold.
- **Multi-Language Support**: Available in multiple languages with community translations via [Crowdin](https://crowdin.com/project/speedtest-tracker).

## Getting Started

Expand All @@ -20,4 +21,12 @@ Speedtest Tracker is containerized so you can run it anywhere you run your conta
- [Notifications](https://docs.speedtest-tracker.dev/settings/notifications) channels alert you when issues happen.
- [Frequently Asked Questions](https://docs.speedtest-tracker.dev/help/faqs) are common questions that can help you resolve issues.

## Translations

Speedtest Tracker supports multiple languages thanks to our community translators!

**Request a new language**: Visit our [Crowdin project](https://crowdin.com/project/speedtest-tracker) and request a new language directly in crowdin.

**Help translate**: Join our [Crowdin project](https://crowdin.com/project/speedtest-tracker) to contribute translations in your language. All translation levels are welcome!

[![Star History Chart](https://api.star-history.com/svg?repos=alexjustesen/speedtest-tracker&type=Date)](https://star-history.com/#alexjustesen/speedtest-tracker&Date)
16 changes: 7 additions & 9 deletions app/Actions/Notifications/SendDatabaseTestNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ class SendDatabaseTestNotification

public function handle(User $user)
{
$user->notify(
Notification::make()
->title('Test database notification received!')
->body('You say pong')
->success()
->toDatabase(),
);
Notification::make()
->title(__('settings/notifications.test_notifications.database.received'))
->body(__('settings/notifications.test_notifications.database.pong'))
->success()
->sendToDatabase($user);

Notification::make()
->title('Test database notification sent.')
->body('I say ping')
->title(__('settings/notifications.test_notifications.database.sent'))
->body(__('settings/notifications.test_notifications.database.ping'))
->success()
->send();
}
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Notifications/SendMailTestNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function handle(array $recipients)
{
if (! count($recipients)) {
Notification::make()
->title('You need to add mail recipients!')
->title(__('settings/notifications.test_notifications.mail.add'))
->warning()
->send();

Expand All @@ -28,7 +28,7 @@ public function handle(array $recipients)
}

Notification::make()
->title('Test mail notification sent.')
->title(__('settings/notifications.test_notifications.mail.sent'))
->success()
->send();
}
Expand Down
6 changes: 3 additions & 3 deletions app/Actions/Notifications/SendWebhookTestNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function handle(array $webhooks)
{
if (! count($webhooks)) {
Notification::make()
->title('You need to add webhook URLs!')
->title(__('settings/notifications.test_notifications.webhook.add'))
->warning()
->send();

Expand All @@ -32,7 +32,7 @@ public function handle(array $webhooks)
->url($webhook['url'])
->payload([
'result_id' => Str::uuid(),
'site_name' => 'Webhook Notification Testing',
'site_name' => __('settings/notifications.test_notifications.webhook.payload'),
'isp' => $fakeResult->data['isp'],
'ping' => $fakeResult->ping,
'download' => $fakeResult->download,
Expand All @@ -46,7 +46,7 @@ public function handle(array $webhooks)
}

Notification::make()
->title('Test webhook notification sent.')
->title(__('settings/notifications.test_notifications.webhook.sent'))
->success()
->send();
}
Expand Down
6 changes: 4 additions & 2 deletions app/Enums/ResultService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
use Illuminate\Support\Str;

enum ResultService: string implements HasLabel
{
Expand All @@ -12,6 +11,9 @@ enum ResultService: string implements HasLabel

public function getLabel(): ?string
{
return Str::title($this->name);
return match ($this) {
self::Faker => __('enums.service.faker'),
self::Ookla => __('enums.service.ookla'),
};
}
}
12 changes: 10 additions & 2 deletions app/Enums/ResultStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
use Illuminate\Support\Str;

enum ResultStatus: string implements HasColor, HasLabel
{
Expand Down Expand Up @@ -33,6 +32,15 @@ public function getColor(): ?string

public function getLabel(): ?string
{
return Str::title($this->name);
return match ($this) {
self::Benchmarking => __('enums.status.benchmarking'),
self::Checking => __('enums.status.checking'),
self::Completed => __('enums.status.completed'),
self::Failed => __('enums.status.failed'),
self::Running => __('enums.status.running'),
self::Started => __('enums.status.started'),
self::Skipped => __('enums.status.skipped'),
self::Waiting => __('enums.status.waiting'),
};
}
}
6 changes: 4 additions & 2 deletions app/Enums/UserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
use Illuminate\Support\Str;

enum UserRole: string implements HasColor, HasLabel
{
Expand All @@ -21,6 +20,9 @@ public function getColor(): ?string

public function getLabel(): ?string
{
return Str::title($this->name);
return match ($this) {
self::Admin => __('general.admin'),
self::User => __('general.user'),
};
}
}
14 changes: 12 additions & 2 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,29 @@ class Dashboard extends BasePage

protected string $view = 'filament.pages.dashboard';

public function getTitle(): string
{
return __('dashboard.title');
}

public static function getNavigationLabel(): string
{
return __('dashboard.title');
}

public function getSubheading(): ?string
{
$schedule = config('speedtest.schedule');

if (blank($schedule) || $schedule === false) {
return __('No speedtests scheduled.');
return __('dashboard.no_speedtests_scheduled');
}

$cronExpression = new CronExpression($schedule);

$nextRunDate = Carbon::parse($cronExpression->getNextRunDate(timeZone: config('app.display_timezone')))->format(config('app.datetime_format'));

return 'Next speedtest at: '.$nextRunDate;
return __('dashboard.next_speedtest_at').': '.$nextRunDate;
}

protected function getHeaderWidgets(): array
Expand Down
38 changes: 22 additions & 16 deletions app/Filament/Pages/Settings/DataIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ class DataIntegration extends SettingsPage

protected static ?int $navigationSort = 2;

protected static ?string $title = 'Data Integration';
public function getTitle(): string
{
return __('settings/data_integration.title');
}

protected static ?string $navigationLabel = 'Data Integration';
public static function getNavigationLabel(): string
{
return __('settings/data_integration.label');
}

protected static string $settings = DataIntegrationSettings::class;

Expand All @@ -51,49 +57,49 @@ public function form(Schema $schema): Schema
'md' => 3,
])
->schema([
Section::make('InfluxDB v2')
->description('When enabled, all new Speedtest results will also be sent to InfluxDB.')
Section::make(__('settings/data_integration.influxdb_v2'))
->description(__('settings/data_integration.influxdb_v2_description'))
->schema([
Toggle::make('influxdb_v2_enabled')
->label('Enable')
->label(__('settings/data_integration.influxdb_v2_enabled'))
->reactive()
->columnSpanFull(),
Grid::make(['default' => 1, 'md' => 3])
->hidden(fn (Get $get) => $get('influxdb_v2_enabled') !== true)
->schema([
TextInput::make('influxdb_v2_url')
->label('URL')
->placeholder('http://your-influxdb-instance')
->label(__('settings/data_integration.influxdb_v2_url'))
->placeholder(__('settings/data_integration.influxdb_v2_url_placeholder'))
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 1]),
TextInput::make('influxdb_v2_org')
->label('Org')
->label(__('settings/data_integration.influxdb_v2_org'))
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 1]),
TextInput::make('influxdb_v2_bucket')
->placeholder('speedtest-tracker')
->label('Bucket')
->placeholder(__('settings/data_integration.influxdb_v2_bucket_placeholder'))
->label(__('settings/data_integration.influxdb_v2_bucket'))
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 2]),
TextInput::make('influxdb_v2_token')
->label('Token')
->label(__('settings/data_integration.influxdb_v2_token'))
->maxLength(255)
->password()
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 2]),
Checkbox::make('influxdb_v2_verify_ssl')
->label('Verify SSL')
->label(__('settings/data_integration.influxdb_v2_verify_ssl'))
->columnSpanFull(),
// Button to send old data to InfluxDB
Actions::make([
Action::make('Export current results')
->label('Export current results')
->label(__('general.export_current_results'))
->action(function () {
Notification::make()
->title('Starting bulk data write to Influxdb')
->title(__('settings/data_integration.starting_bulk_data_write_to_influxdb'))
->info()
->send();

Expand All @@ -106,10 +112,10 @@ public function form(Schema $schema): Schema
// Button to test InfluxDB connection
Actions::make([
Action::make('Test connection')
->label('Test connection')
->label(__('settings/data_integration.test_connection'))
->action(function () {
Notification::make()
->title('Sending test data to Influxdb')
->title(__('settings/data_integration.sending_test_data_to_influxdb'))
->info()
->send();

Expand Down
Loading