From 5305b4f1b86256f2a9258f3f78cebfaac07e6a42 Mon Sep 17 00:00:00 2001 From: Sven van Ginkel Date: Wed, 27 Nov 2024 13:30:54 +0100 Subject: [PATCH 1/4] [Feature] Change toolbar button to Public Dashboard (#1849) Change to public Dashboard --- app/Livewire/Topbar/RunSpeedtestAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/Topbar/RunSpeedtestAction.php b/app/Livewire/Topbar/RunSpeedtestAction.php index fc58a0a5b..e1b0ee5c6 100644 --- a/app/Livewire/Topbar/RunSpeedtestAction.php +++ b/app/Livewire/Topbar/RunSpeedtestAction.php @@ -22,7 +22,7 @@ class RunSpeedtestAction extends Component implements HasActions, HasForms public function dashboardAction(): Action { return Action::make('home') - ->label('Dashboard') + ->label('Public Dashboard') ->icon('heroicon-o-chart-bar') ->iconPosition(IconPosition::Before) ->color('gray') From fbf271fe516d1ed5f7c23ce4b63caca8fa83ba3c Mon Sep 17 00:00:00 2001 From: Sven van Ginkel Date: Wed, 27 Nov 2024 14:43:44 +0100 Subject: [PATCH 2/4] [Feature] Add Average for Download, Upload, Ping (#1837) * Add helper and average line * Fix query --------- Co-authored-by: Alex Justesen --- .../Widgets/RecentDownloadChartWidget.php | 25 +++++++++-- .../RecentDownloadLatencyChartWidget.php | 32 +++++++++----- .../Widgets/RecentJitterChartWidget.php | 32 +++++++++----- .../Widgets/RecentPingChartWidget.php | 27 +++++++++--- .../Widgets/RecentUploadChartWidget.php | 25 +++++++++-- .../RecentUploadLatencyChartWidget.php | 32 +++++++++----- app/Helpers/Average.php | 44 +++++++++++++++++++ 7 files changed, 168 insertions(+), 49 deletions(-) create mode 100644 app/Helpers/Average.php diff --git a/app/Filament/Widgets/RecentDownloadChartWidget.php b/app/Filament/Widgets/RecentDownloadChartWidget.php index 5d4ba1279..3297d91f0 100644 --- a/app/Filament/Widgets/RecentDownloadChartWidget.php +++ b/app/Filament/Widgets/RecentDownloadChartWidget.php @@ -3,6 +3,7 @@ namespace App\Filament\Widgets; use App\Enums\ResultStatus; +use App\Helpers\Average; use App\Helpers\Number; use App\Models\Result; use Filament\Widgets\ChartWidget; @@ -53,12 +54,22 @@ protected function getData(): array [ 'label' => 'Download', 'data' => $results->map(fn ($item) => ! blank($item->download) ? Number::bitsToMagnitude(bits: $item->download_bits, precision: 2, magnitude: 'mbit') : null), - 'borderColor' => '#0ea5e9', - 'backgroundColor' => '#0ea5e9', - 'pointBackgroundColor' => '#0ea5e9', + 'borderColor' => 'rgba(14, 165, 233)', + 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', + 'pointBackgroundColor' => 'rgba(14, 165, 233)', + 'cubicInterpolationMode' => 'monotone', + 'tension' => 0.4, + ], + [ + 'label' => 'Average', + 'data' => array_fill(0, count($results), Average::averageDownload($results)), + 'borderColor' => 'rgb(243, 7, 6, 1)', + 'pointBackgroundColor' => 'rgb(243, 7, 6, 1)', 'fill' => false, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'borderDash' => [5, 5], + 'pointRadius' => 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -70,7 +81,13 @@ protected function getOptions(): array return [ 'plugins' => [ 'legend' => [ - 'display' => false, + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', ], ], 'scales' => [ diff --git a/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php b/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php index e588ac38e..fcb758c7a 100644 --- a/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php +++ b/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php @@ -52,30 +52,27 @@ protected function getData(): array [ 'label' => 'Average (ms)', 'data' => $results->map(fn ($item) => $item->download_latency_iqm), - 'borderColor' => '#10b981', - 'backgroundColor' => '#10b981', - 'pointBackgroundColor' => '#10b981', - 'fill' => false, + 'borderColor' => 'rgba(16, 185, 129)', + 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', + 'pointBackgroundColor' => 'rgba(16, 185, 129)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'High (ms)', 'data' => $results->map(fn ($item) => $item->download_latency_high), - 'borderColor' => '#0ea5e9', - 'backgroundColor' => '#0ea5e9', - 'pointBackgroundColor' => '#0ea5e9', - 'fill' => false, + 'borderColor' => 'rgba(14, 165, 233)', + 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', + 'pointBackgroundColor' => 'rgba(14, 165, 233)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'Low (ms)', 'data' => $results->map(fn ($item) => $item->download_latency_low), - 'borderColor' => '#8b5cf6', - 'backgroundColor' => '#8b5cf6', - 'pointBackgroundColor' => '#8b5cf6', - 'fill' => false, + 'borderColor' => 'rgba(139, 92, 246)', + 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', + 'pointBackgroundColor' => 'rgba(139, 92, 246)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], @@ -87,6 +84,17 @@ protected function getData(): array protected function getOptions(): array { return [ + 'plugins' => [ + 'legend' => [ + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', + ], + ], 'scales' => [ 'y' => [ 'beginAtZero' => true, diff --git a/app/Filament/Widgets/RecentJitterChartWidget.php b/app/Filament/Widgets/RecentJitterChartWidget.php index b0bfc1fea..78a7a80a9 100644 --- a/app/Filament/Widgets/RecentJitterChartWidget.php +++ b/app/Filament/Widgets/RecentJitterChartWidget.php @@ -52,30 +52,27 @@ protected function getData(): array [ 'label' => 'Download (ms)', 'data' => $results->map(fn ($item) => $item->download_jitter), - 'borderColor' => '#0ea5e9', - 'backgroundColor' => '#0ea5e9', - 'pointBackgroundColor' => '#0ea5e9', - 'fill' => false, + 'borderColor' => 'rgba(14, 165, 233)', + 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', + 'pointBackgroundColor' => 'rgba(14, 165, 233)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'Upload (ms)', 'data' => $results->map(fn ($item) => $item->upload_jitter), - 'borderColor' => '#8b5cf6', - 'backgroundColor' => '#8b5cf6', - 'pointBackgroundColor' => '#8b5cf6', - 'fill' => false, + 'borderColor' => 'rgba(139, 92, 246)', + 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', + 'pointBackgroundColor' => 'rgba(139, 92, 246)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'Ping (ms)', 'data' => $results->map(fn ($item) => $item->ping_jitter), - 'borderColor' => '#10b981', - 'backgroundColor' => '#10b981', - 'pointBackgroundColor' => '#10b981', - 'fill' => false, + 'borderColor' => 'rgba(16, 185, 129)', + 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', + 'pointBackgroundColor' => 'rgba(16, 185, 129)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], @@ -87,6 +84,17 @@ protected function getData(): array protected function getOptions(): array { return [ + 'plugins' => [ + 'legend' => [ + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', + ], + ], 'scales' => [ 'y' => [ 'beginAtZero' => true, diff --git a/app/Filament/Widgets/RecentPingChartWidget.php b/app/Filament/Widgets/RecentPingChartWidget.php index f0b9781f7..6455de4fe 100644 --- a/app/Filament/Widgets/RecentPingChartWidget.php +++ b/app/Filament/Widgets/RecentPingChartWidget.php @@ -3,6 +3,7 @@ namespace App\Filament\Widgets; use App\Enums\ResultStatus; +use App\Helpers\Average; use App\Models\Result; use Filament\Widgets\ChartWidget; @@ -50,14 +51,24 @@ protected function getData(): array return [ 'datasets' => [ [ - 'label' => 'Ping (ms)', + 'label' => 'Ping', 'data' => $results->map(fn ($item) => $item->ping), - 'borderColor' => '#10b981', - 'backgroundColor' => '#10b981', - 'pointBackgroundColor' => '#10b981', + 'borderColor' => 'rgba(16, 185, 129)', + 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', + 'pointBackgroundColor' => 'rgba(16, 185, 129)', + 'cubicInterpolationMode' => 'monotone', + 'tension' => 0.4, + ], + [ + 'label' => 'Average', + 'data' => array_fill(0, count($results), Average::averagePing($results)), + 'borderColor' => 'rgb(243, 7, 6, 1)', + 'pointBackgroundColor' => 'rgb(243, 7, 6, 1)', 'fill' => false, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'borderDash' => [5, 5], + 'pointRadius' => 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -69,7 +80,13 @@ protected function getOptions(): array return [ 'plugins' => [ 'legend' => [ - 'display' => false, + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', ], ], 'scales' => [ diff --git a/app/Filament/Widgets/RecentUploadChartWidget.php b/app/Filament/Widgets/RecentUploadChartWidget.php index c31345c8b..c8c5ddc45 100644 --- a/app/Filament/Widgets/RecentUploadChartWidget.php +++ b/app/Filament/Widgets/RecentUploadChartWidget.php @@ -3,6 +3,7 @@ namespace App\Filament\Widgets; use App\Enums\ResultStatus; +use App\Helpers\Average; use App\Helpers\Number; use App\Models\Result; use Filament\Widgets\ChartWidget; @@ -53,12 +54,22 @@ protected function getData(): array [ 'label' => 'Upload', 'data' => $results->map(fn ($item) => ! blank($item->upload) ? Number::bitsToMagnitude(bits: $item->upload_bits, precision: 2, magnitude: 'mbit') : null), - 'borderColor' => '#8b5cf6', - 'backgroundColor' => '#8b5cf6', - 'pointBackgroundColor' => '#8b5cf6', + 'borderColor' => 'rgba(139, 92, 246)', + 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', + 'pointBackgroundColor' => 'rgba(139, 92, 246)', + 'cubicInterpolationMode' => 'monotone', + 'tension' => 0.4, + ], + [ + 'label' => 'Average', + 'data' => array_fill(0, count($results), Average::averageUpload($results)), + 'borderColor' => 'rgb(243, 7, 6, 1)', + 'pointBackgroundColor' => 'rgb(243, 7, 6, 1)', 'fill' => false, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'borderDash' => [5, 5], + 'pointRadius' => 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -70,7 +81,13 @@ protected function getOptions(): array return [ 'plugins' => [ 'legend' => [ - 'display' => false, + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', ], ], 'scales' => [ diff --git a/app/Filament/Widgets/RecentUploadLatencyChartWidget.php b/app/Filament/Widgets/RecentUploadLatencyChartWidget.php index 956092b37..f6ab7e31d 100644 --- a/app/Filament/Widgets/RecentUploadLatencyChartWidget.php +++ b/app/Filament/Widgets/RecentUploadLatencyChartWidget.php @@ -52,30 +52,27 @@ protected function getData(): array [ 'label' => 'Average (ms)', 'data' => $results->map(fn ($item) => $item->upload_latency_iqm), - 'borderColor' => '#10b981', - 'backgroundColor' => '#10b981', - 'pointBackgroundColor' => '#10b981', - 'fill' => false, + 'borderColor' => 'rgba(16, 185, 129)', + 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', + 'pointBackgroundColor' => 'rgba(16, 185, 129)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'High (ms)', 'data' => $results->map(fn ($item) => $item->upload_latency_high), - 'borderColor' => '#0ea5e9', - 'backgroundColor' => '#0ea5e9', - 'pointBackgroundColor' => '#0ea5e9', - 'fill' => false, + 'borderColor' => 'rgba(14, 165, 233)', + 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', + 'pointBackgroundColor' => 'rgba(14, 165, 233)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], [ 'label' => 'Low (ms)', 'data' => $results->map(fn ($item) => $item->upload_latency_low), - 'borderColor' => '#8b5cf6', - 'backgroundColor' => '#8b5cf6', - 'pointBackgroundColor' => '#8b5cf6', - 'fill' => false, + 'borderColor' => 'rgba(139, 92, 246)', + 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', + 'pointBackgroundColor' => 'rgba(139, 92, 246)', 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, ], @@ -87,6 +84,17 @@ protected function getData(): array protected function getOptions(): array { return [ + 'plugins' => [ + 'legend' => [ + 'display' => true, + ], + 'tooltip' => [ + 'enabled' => true, + 'mode' => 'index', + 'intersect' => false, + 'position' => 'nearest', + ], + ], 'scales' => [ 'y' => [ 'beginAtZero' => true, diff --git a/app/Helpers/Average.php b/app/Helpers/Average.php new file mode 100644 index 000000000..c93d2d5cd --- /dev/null +++ b/app/Helpers/Average.php @@ -0,0 +1,44 @@ +map(function ($item) use ($magnitude, $precision) { + return ! blank($item->download) + ? Number::bitsToMagnitude(bits: $item->download_bits, precision: $precision, magnitude: $magnitude) + : 0; + })->avg(), + $precision + ); + } + + public static function averageUpload(Collection $results, int $precision = 2, string $magnitude = 'mbit'): float + { + return round( + $results->map(function ($item) use ($magnitude, $precision) { + return ! blank($item->upload) + ? Number::bitsToMagnitude(bits: $item->upload_bits, precision: $precision, magnitude: $magnitude) + : 0; + })->avg(), + $precision + ); + } + + public static function averagePing(Collection $results, int $precision = 2): float + { + $avgPing = $results->filter(function ($item) { + return ! blank($item->ping); + })->avg('ping'); + + return round($avgPing, $precision); + } +} From 9e69d7e2ab0194fa13de30c04191f9cc3bd37e1d Mon Sep 17 00:00:00 2001 From: Sven van Ginkel Date: Wed, 27 Nov 2024 16:02:12 +0100 Subject: [PATCH 3/4] [Feature] Fill charts with 10% and make beginAtZero configurable (#1839) * set fill to true and start at zero in config * fix legend * Fix conflicts * ordered config * Change pointRadius to 24 --------- Co-authored-by: Alex Justesen --- app/Filament/Widgets/RecentDownloadChartWidget.php | 5 ++++- app/Filament/Widgets/RecentDownloadLatencyChartWidget.php | 8 +++++++- app/Filament/Widgets/RecentJitterChartWidget.php | 8 +++++++- app/Filament/Widgets/RecentPingChartWidget.php | 4 +++- app/Filament/Widgets/RecentUploadChartWidget.php | 4 +++- app/Filament/Widgets/RecentUploadLatencyChartWidget.php | 8 +++++++- config/app.php | 2 ++ 7 files changed, 33 insertions(+), 6 deletions(-) diff --git a/app/Filament/Widgets/RecentDownloadChartWidget.php b/app/Filament/Widgets/RecentDownloadChartWidget.php index 3297d91f0..4600a3f21 100644 --- a/app/Filament/Widgets/RecentDownloadChartWidget.php +++ b/app/Filament/Widgets/RecentDownloadChartWidget.php @@ -57,8 +57,10 @@ protected function getData(): array 'borderColor' => 'rgba(14, 165, 233)', 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', 'pointBackgroundColor' => 'rgba(14, 165, 233)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Average', @@ -82,6 +84,7 @@ protected function getOptions(): array 'plugins' => [ 'legend' => [ 'display' => true, + ], 'tooltip' => [ 'enabled' => true, @@ -92,7 +95,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php b/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php index fcb758c7a..b5040abc9 100644 --- a/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php +++ b/app/Filament/Widgets/RecentDownloadLatencyChartWidget.php @@ -55,8 +55,10 @@ protected function getData(): array 'borderColor' => 'rgba(16, 185, 129)', 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', 'pointBackgroundColor' => 'rgba(16, 185, 129)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'High (ms)', @@ -64,8 +66,10 @@ protected function getData(): array 'borderColor' => 'rgba(14, 165, 233)', 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', 'pointBackgroundColor' => 'rgba(14, 165, 233)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Low (ms)', @@ -73,8 +77,10 @@ protected function getData(): array 'borderColor' => 'rgba(139, 92, 246)', 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', 'pointBackgroundColor' => 'rgba(139, 92, 246)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -97,7 +103,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/app/Filament/Widgets/RecentJitterChartWidget.php b/app/Filament/Widgets/RecentJitterChartWidget.php index 78a7a80a9..5db523eca 100644 --- a/app/Filament/Widgets/RecentJitterChartWidget.php +++ b/app/Filament/Widgets/RecentJitterChartWidget.php @@ -55,8 +55,10 @@ protected function getData(): array 'borderColor' => 'rgba(14, 165, 233)', 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', 'pointBackgroundColor' => 'rgba(14, 165, 233)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Upload (ms)', @@ -64,8 +66,10 @@ protected function getData(): array 'borderColor' => 'rgba(139, 92, 246)', 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', 'pointBackgroundColor' => 'rgba(139, 92, 246)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Ping (ms)', @@ -73,8 +77,10 @@ protected function getData(): array 'borderColor' => 'rgba(16, 185, 129)', 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', 'pointBackgroundColor' => 'rgba(16, 185, 129)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -97,7 +103,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/app/Filament/Widgets/RecentPingChartWidget.php b/app/Filament/Widgets/RecentPingChartWidget.php index 6455de4fe..240710057 100644 --- a/app/Filament/Widgets/RecentPingChartWidget.php +++ b/app/Filament/Widgets/RecentPingChartWidget.php @@ -56,8 +56,10 @@ protected function getData(): array 'borderColor' => 'rgba(16, 185, 129)', 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', 'pointBackgroundColor' => 'rgba(16, 185, 129)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Average', @@ -91,7 +93,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/app/Filament/Widgets/RecentUploadChartWidget.php b/app/Filament/Widgets/RecentUploadChartWidget.php index c8c5ddc45..00d07a098 100644 --- a/app/Filament/Widgets/RecentUploadChartWidget.php +++ b/app/Filament/Widgets/RecentUploadChartWidget.php @@ -57,8 +57,10 @@ protected function getData(): array 'borderColor' => 'rgba(139, 92, 246)', 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', 'pointBackgroundColor' => 'rgba(139, 92, 246)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Average', @@ -92,7 +94,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/app/Filament/Widgets/RecentUploadLatencyChartWidget.php b/app/Filament/Widgets/RecentUploadLatencyChartWidget.php index f6ab7e31d..9397f8c52 100644 --- a/app/Filament/Widgets/RecentUploadLatencyChartWidget.php +++ b/app/Filament/Widgets/RecentUploadLatencyChartWidget.php @@ -55,8 +55,10 @@ protected function getData(): array 'borderColor' => 'rgba(16, 185, 129)', 'backgroundColor' => 'rgba(16, 185, 129, 0.1)', 'pointBackgroundColor' => 'rgba(16, 185, 129)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'High (ms)', @@ -64,8 +66,10 @@ protected function getData(): array 'borderColor' => 'rgba(14, 165, 233)', 'backgroundColor' => 'rgba(14, 165, 233, 0.1)', 'pointBackgroundColor' => 'rgba(14, 165, 233)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], [ 'label' => 'Low (ms)', @@ -73,8 +77,10 @@ protected function getData(): array 'borderColor' => 'rgba(139, 92, 246)', 'backgroundColor' => 'rgba(139, 92, 246, 0.1)', 'pointBackgroundColor' => 'rgba(139, 92, 246)', + 'fill' => true, 'cubicInterpolationMode' => 'monotone', 'tension' => 0.4, + 'pointRadius' => count($results) <= 24 ? 3 : 0, ], ], 'labels' => $results->map(fn ($item) => $item->created_at->timezone(config('app.display_timezone'))->format(config('app.chart_datetime_format'))), @@ -97,7 +103,7 @@ protected function getOptions(): array ], 'scales' => [ 'y' => [ - 'beginAtZero' => true, + 'beginAtZero' => config('app.chart_begin_at_zero'), ], ], ]; diff --git a/config/app.php b/config/app.php index 60b38f700..8f63418fa 100644 --- a/config/app.php +++ b/config/app.php @@ -6,6 +6,8 @@ 'env' => env('APP_ENV', 'production'), + 'chart_begin_at_zero' => env('CHART_BEGIN_AT_ZERO', true), + 'chart_datetime_format' => env('CHART_DATETIME_FORMAT', 'M. j - G:i'), 'datetime_format' => env('DATETIME_FORMAT', 'M. jS, Y g:ia'), From 4dae4c864d4a181c37e5115e366a291190b4e3eb Mon Sep 17 00:00:00 2001 From: Alex Justesen Date: Wed, 27 Nov 2024 10:16:11 -0500 Subject: [PATCH 4/4] Release v0.24.3 (#1851) bumped build info --- config/speedtest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/speedtest.php b/config/speedtest.php index 4649a7daa..6a8b40284 100644 --- a/config/speedtest.php +++ b/config/speedtest.php @@ -4,9 +4,9 @@ return [ - 'build_date' => Carbon::parse('2024-11-26'), + 'build_date' => Carbon::parse('2024-11-27'), - 'build_version' => 'v0.24.2', + 'build_version' => 'v0.24.3', /** * General settings.