Skip to content

Commit 2d9ea93

Browse files
authored
Results time zones, datetime formats and readme improvements (#71)
1 parent 71f0efb commit 2d9ea93

20 files changed

+50
-844
lines changed
82.1 KB
Loading
99.5 KB
Loading
686 KB
Loading
159 KB
Loading

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
## Speedtest Tracker
22

3-
Welcome to Speedtest Tracker! Speedtest Tracker runs a speedtest check against Ookla's Speedtest service on a schedule.
3+
Speedtest Tracker is a self-hosted internet performance tracking application that runs speedtest checks against Ookla's Speedtest service.
44

5-
This project replaces https://github.com/henrywhitaker3/Speedtest-Tracker as it looks like this project has been abandoned https://github.com/henrywhitaker3/Speedtest-Tracker/issues/1013.
5+
### Why might I use this?
6+
The main use case for Speedtest Tracker is to build a history of your internet's performance so that you can be informed when you're not receiving your ISP's advertised rates.
67

7-
### Docs
8-
The docs can be found here https://docs.speedtest-tracker.dev to help you get started.
8+
### What about that other Speedtest Tracker?
9+
As far as I can tell https://github.com/henrywhitaker3/Speedtest-Tracker was abandoned. This version is meant to be an actively maintained replacement with an improved UI and feature set.
910

10-
### Roadmap
11-
To suggest features please use the roadmap. You can also follow development progress there as well: https://speedtest-tracker-roadmap.alexjustesen.dev/
11+
### Documentation and Features
12+
The docs can be found here https://docs.speedtest-tracker.dev to help you get started and also contains a full list of features.
13+
14+
### Screenshots
15+
#### Dashboard
16+
![Dashboard](.github/screenshots/dashboard_screenshot.png)
17+
18+
#### Results page
19+
![Results page](.github/screenshots/results_screenshot.png)
20+
21+
#### General Settings page
22+
![General Settings page](.github/screenshots/general_settings_screenshot.png)

app/Filament/Pages/Settings/General.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ protected function getFormSchema(): array
4444
Select::make('timezone')
4545
->options(Timezone::all()->pluck('code', 'code'))
4646
->searchable()
47-
->required()
48-
->columnSpan(1),
47+
->required(),
48+
TextInput::make('time_format')
49+
->helperText('Use [DateTime Format](https://www.php.net/manual/en/datetime.format.php) options to change the format of the datetime in views.')
50+
->placeholder('M j, Y G:i:s')
51+
->maxLength(25)
52+
->required(),
4953
])
5054
->columns([
5155
'default' => 1,

app/Filament/Resources/ResultResource.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
use App\Filament\Resources\ResultResource\Pages;
66
use App\Models\Result;
7+
use App\Settings\GeneralSettings;
78
use Filament\Resources\Resource;
89
use Filament\Resources\Table;
910
use Filament\Tables;
11+
use Filament\Tables\Actions\Action;
12+
use Filament\Tables\Columns\IconColumn;
1013
use Filament\Tables\Columns\TextColumn;
1114
use Filament\Tables\Columns\ViewColumn;
1215

@@ -20,10 +23,14 @@ class ResultResource extends Resource
2023

2124
public static function table(Table $table): Table
2225
{
26+
$settings = new GeneralSettings();
27+
2328
return $table
2429
->columns([
2530
TextColumn::make('id')
2631
->label('ID'),
32+
IconColumn::make('scheduled')
33+
->boolean(),
2734
ViewColumn::make('download')
2835
->view('tables.columns.bits-column'),
2936
ViewColumn::make('upload')
@@ -33,13 +40,18 @@ public static function table(Table $table): Table
3340
->label('Server ID')
3441
->view('tables.columns.server-column'),
3542
TextColumn::make('created_at')
36-
->dateTime(),
43+
->dateTime($settings->time_format ?? 'M j, Y G:i:s')
44+
->timezone($settings->timezone ?? 'UTC'),
3745
])
3846
->filters([
3947
//
4048
])
4149
->actions([
4250
// Tables\Actions\ViewAction::make(),
51+
Action::make('view result')
52+
->label('View on Speedtest.net')
53+
->url(fn (Result $record): string => $record->url)
54+
->openUrlInNewTab(),
4355
Tables\Actions\DeleteAction::make(),
4456
])
4557
->bulkActions([

app/Settings/GeneralSettings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class GeneralSettings extends Settings
1414

1515
public string $site_name;
1616

17+
public string $time_format;
18+
1719
public string $timezone;
1820

1921
public static function group(): string

config/filament.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
|
263263
*/
264264

265-
'favicon' => null,
265+
'favicon' => public_path('img/speedtest-tracker-icon.png'),
266266

267267
/*
268268
|--------------------------------------------------------------------------
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Spatie\LaravelSettings\Migrations\SettingsMigration;
4+
5+
class AddTimeFormatToGeneralSettings extends SettingsMigration
6+
{
7+
public function up(): void
8+
{
9+
$this->migrator->add('general.time_format', 'M j, Y G:i:s');
10+
}
11+
}

0 commit comments

Comments
 (0)