diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php index 6db680a00..bc6d7591d 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Pages/Dashboard.php @@ -2,20 +2,11 @@ namespace App\Filament\Pages; -use App\Filament\Widgets\RecentDownloadChartWidget; -use App\Filament\Widgets\RecentDownloadLatencyChartWidget; -use App\Filament\Widgets\RecentJitterChartWidget; -use App\Filament\Widgets\RecentPingChartWidget; -use App\Filament\Widgets\RecentUploadChartWidget; -use App\Filament\Widgets\RecentUploadLatencyChartWidget; -use App\Filament\Widgets\StatsOverviewWidget; -use Carbon\Carbon; -use Cron\CronExpression; use Filament\Pages\Dashboard as BasePage; class Dashboard extends BasePage { - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-chart-bar'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-layout-dashboard'; protected string $view = 'filament.pages.dashboard'; @@ -28,32 +19,4 @@ public static function getNavigationLabel(): string { return __('dashboard.title'); } - - public function getSubheading(): ?string - { - $schedule = config('speedtest.schedule'); - - if (blank($schedule) || $schedule === false) { - 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 __('dashboard.next_speedtest_at').': '.$nextRunDate; - } - - protected function getHeaderWidgets(): array - { - return [ - StatsOverviewWidget::make(), - RecentDownloadChartWidget::make(), - RecentUploadChartWidget::make(), - RecentPingChartWidget::make(), - RecentJitterChartWidget::make(), - RecentDownloadLatencyChartWidget::make(), - RecentUploadLatencyChartWidget::make(), - ]; - } } diff --git a/app/Filament/Pages/Settings/DataIntegration.php b/app/Filament/Pages/Settings/DataIntegration.php index d61f41df8..e680627dd 100644 --- a/app/Filament/Pages/Settings/DataIntegration.php +++ b/app/Filament/Pages/Settings/DataIntegration.php @@ -23,7 +23,7 @@ class DataIntegration extends SettingsPage { - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-circle-stack'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-database'; protected static string|\UnitEnum|null $navigationGroup = 'Settings'; diff --git a/app/Filament/Pages/Settings/Notification.php b/app/Filament/Pages/Settings/Notification.php index f2fb0f2da..9a5decb00 100755 --- a/app/Filament/Pages/Settings/Notification.php +++ b/app/Filament/Pages/Settings/Notification.php @@ -35,7 +35,7 @@ class Notification extends SettingsPage { - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-bell-alert'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-bell-ringing'; protected static string|\UnitEnum|null $navigationGroup = 'Settings'; diff --git a/app/Filament/Pages/Settings/Thresholds.php b/app/Filament/Pages/Settings/Thresholds.php index 6c8adb4ab..1953ff52a 100644 --- a/app/Filament/Pages/Settings/Thresholds.php +++ b/app/Filament/Pages/Settings/Thresholds.php @@ -15,7 +15,7 @@ class Thresholds extends SettingsPage { - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-exclamation-triangle'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-alert-triangle'; protected static string|\UnitEnum|null $navigationGroup = 'Settings'; diff --git a/app/Filament/Resources/Results/ResultResource.php b/app/Filament/Resources/Results/ResultResource.php index 6efd4a9f4..5ff0893d7 100644 --- a/app/Filament/Resources/Results/ResultResource.php +++ b/app/Filament/Resources/Results/ResultResource.php @@ -14,7 +14,7 @@ class ResultResource extends Resource { protected static ?string $model = Result::class; - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-table-cells'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-table'; public static function getNavigationLabel(): string { diff --git a/app/Filament/Resources/Users/UserResource.php b/app/Filament/Resources/Users/UserResource.php index 914172ab8..c1b2d958d 100644 --- a/app/Filament/Resources/Users/UserResource.php +++ b/app/Filament/Resources/Users/UserResource.php @@ -14,9 +14,7 @@ class UserResource extends Resource { protected static ?string $model = User::class; - protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-users'; - - protected static string|\UnitEnum|null $navigationGroup = 'Settings'; + protected static string|\BackedEnum|null $navigationIcon = 'tabler-users'; protected static ?int $navigationSort = 4; diff --git a/app/Filament/Widgets/StatsOverviewWidget.php b/app/Filament/Widgets/StatsOverviewWidget.php deleted file mode 100644 index 8178c10e3..000000000 --- a/app/Filament/Widgets/StatsOverviewWidget.php +++ /dev/null @@ -1,76 +0,0 @@ -result = Result::query() - ->select(['id', 'ping', 'download', 'upload', 'status', 'created_at']) - ->where('status', '=', ResultStatus::Completed) - ->latest() - ->first(); - - if (blank($this->result)) { - return [ - Stat::make(__('dashboard.latest_download'), '-') - ->icon('heroicon-o-arrow-down-tray'), - Stat::make(__('dashboard.latest_upload'), '-') - ->icon('heroicon-o-arrow-up-tray'), - Stat::make(__('dashboard.latest_ping'), '-') - ->icon('heroicon-o-clock'), - ]; - } - - $previous = Result::query() - ->select(['id', 'ping', 'download', 'upload', 'status', 'created_at']) - ->where('id', '<', $this->result->id) - ->where('status', '=', ResultStatus::Completed) - ->latest() - ->first(); - - if (! $previous) { - return [ - Stat::make(__('dashboard.latest_download'), fn (): string => ! blank($this->result) ? Number::toBitRate(bits: $this->result->download_bits, precision: 2) : 'n/a') - ->icon('heroicon-o-arrow-down-tray'), - Stat::make(__('dashboard.latest_upload'), fn (): string => ! blank($this->result) ? Number::toBitRate(bits: $this->result->upload_bits, precision: 2) : 'n/a') - ->icon('heroicon-o-arrow-up-tray'), - Stat::make(__('dashboard.latest_ping'), fn (): string => ! blank($this->result) ? number_format($this->result->ping, 2).' ms' : 'n/a') - ->icon('heroicon-o-clock'), - ]; - } - - $downloadChange = percentChange($this->result->download, $previous->download, 2); - $uploadChange = percentChange($this->result->upload, $previous->upload, 2); - $pingChange = percentChange($this->result->ping, $previous->ping, 2); - - return [ - Stat::make(__('dashboard.latest_download'), fn (): string => ! blank($this->result) ? Number::toBitRate(bits: $this->result->download_bits, precision: 2) : 'n/a') - ->icon('heroicon-o-arrow-down-tray') - ->description($downloadChange > 0 ? $downloadChange.'% '.__('general.faster') : abs($downloadChange).'% '.__('general.slower')) - ->descriptionIcon($downloadChange > 0 ? 'heroicon-m-arrow-trending-up' : 'heroicon-m-arrow-trending-down') - ->color($downloadChange > 0 ? 'success' : 'danger'), - Stat::make(__('dashboard.latest_upload'), fn (): string => ! blank($this->result) ? Number::toBitRate(bits: $this->result->upload_bits, precision: 2) : 'n/a') - ->icon('heroicon-o-arrow-up-tray') - ->description($uploadChange > 0 ? $uploadChange.'% '.__('general.faster') : abs($uploadChange).'% '.__('general.slower')) - ->descriptionIcon($uploadChange > 0 ? 'heroicon-m-arrow-trending-up' : 'heroicon-m-arrow-trending-down') - ->color($uploadChange > 0 ? 'success' : 'danger'), - Stat::make(__('dashboard.latest_ping'), fn (): string => ! blank($this->result) ? number_format($this->result->ping, 2).' ms' : 'n/a') - ->icon('heroicon-o-clock') - ->description($pingChange > 0 ? $pingChange.'% '.__('general.slower') : abs($pingChange).'% '.__('general.faster')) - ->descriptionIcon($pingChange > 0 ? 'heroicon-m-arrow-trending-up' : 'heroicon-m-arrow-trending-down') - ->color($pingChange > 0 ? 'danger' : 'success'), - ]; - } -} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 0b6d0e906..543c692e4 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,8 +2,6 @@ namespace App\Http\Controllers; -use App\Enums\ResultStatus; -use App\Models\Result; use Illuminate\Http\Request; class HomeController extends Controller @@ -13,14 +11,6 @@ class HomeController extends Controller */ public function __invoke(Request $request) { - $latestResult = Result::query() - ->select(['id', 'ping', 'download', 'upload', 'status', 'created_at']) - ->where('status', '=', ResultStatus::Completed) - ->latest() - ->first(); - - return view('dashboard', [ - 'latestResult' => $latestResult, - ]); + return view('dashboard'); } } diff --git a/app/Livewire/LatestResultStats.php b/app/Livewire/LatestResultStats.php new file mode 100644 index 000000000..64217b8ab --- /dev/null +++ b/app/Livewire/LatestResultStats.php @@ -0,0 +1,24 @@ +latest() + ->first(); + } + + public function render() + { + return view('livewire.latest-result-stats'); + } +} diff --git a/app/Livewire/PlatformStats.php b/app/Livewire/PlatformStats.php new file mode 100644 index 000000000..17668eabf --- /dev/null +++ b/app/Livewire/PlatformStats.php @@ -0,0 +1,45 @@ +getNextRunDate(timeZone: config('app.display_timezone'))); + } + + return null; + } + + #[Computed] + public function platformStats(): array + { + $totalResults = Result::count(); + $completedResults = Result::where('status', ResultStatus::Completed)->count(); + $failedResults = Result::where('status', ResultStatus::Failed)->count(); + + return [ + 'total' => Number::format($totalResults), + 'completed' => Number::format($completedResults), + 'failed' => Number::format($failedResults), + ]; + } + + public function render() + { + return view('livewire.platform-stats'); + } +} diff --git a/app/Livewire/Topbar/RunSpeedtestAction.php b/app/Livewire/Topbar/Actions.php similarity index 82% rename from app/Livewire/Topbar/RunSpeedtestAction.php rename to app/Livewire/Topbar/Actions.php index ad8c05271..95a8abcce 100644 --- a/app/Livewire/Topbar/RunSpeedtestAction.php +++ b/app/Livewire/Topbar/Actions.php @@ -13,21 +13,21 @@ use Filament\Forms\Contracts\HasForms; use Filament\Notifications\Notification; use Filament\Support\Enums\IconPosition; +use Filament\Support\Enums\Size; use Illuminate\Support\Facades\Auth; use Livewire\Component; -class RunSpeedtestAction extends Component implements HasActions, HasForms +class Actions extends Component implements HasActions, HasForms { use InteractsWithActions, InteractsWithForms; public function dashboardAction(): Action { - return Action::make('home') - ->label(__('results.public_dashboard')) - ->icon('heroicon-o-chart-bar') - ->iconPosition(IconPosition::Before) + return Action::make('metrics') + ->iconButton() + ->icon('tabler-chart-histogram') ->color('gray') - ->url(shouldOpenInNewTab: true, url: route('home')) + ->url(url: route('home')) ->extraAttributes([ 'id' => 'dashboardAction', ]); @@ -61,13 +61,14 @@ public function speedtestAction(): Action ->success() ->send(); }) - ->modalHeading(__('results.run_speedtest')) + ->modalHeading(__('results.speedtest')) ->modalWidth('lg') ->modalSubmitActionLabel(__('results.start')) ->button() + ->size(Size::Medium) ->color('primary') ->label(__('results.speedtest')) - ->icon('heroicon-o-rocket-launch') + ->icon('tabler-rocket') ->iconPosition(IconPosition::Before) ->hidden(! Auth::check() && Auth::user()->is_admin) ->extraAttributes([ @@ -77,6 +78,6 @@ public function speedtestAction(): Action public function render() { - return view('livewire.topbar.run-speedtest-action'); + return view('livewire.topbar.actions'); } } diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index f72019481..3a6ba6f40 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -2,12 +2,10 @@ namespace App\Providers\Filament; -use App\Services\GitHub\Repository; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\DisableBladeIconComponents; use Filament\Http\Middleware\DispatchServingFilamentEvent; use Filament\Navigation\NavigationGroup; -use Filament\Navigation\NavigationItem; use Filament\Panel; use Filament\PanelProvider; use Filament\Support\Colors\Color; @@ -59,25 +57,8 @@ public function panel(Panel $panel): Panel ]) ->navigationGroups([ NavigationGroup::make() - ->label(__('general.settings')), - NavigationGroup::make() - ->label(__('general.links')) + ->label(__('general.settings')) ->collapsible(false), - ]) - ->navigationItems([ - NavigationItem::make(__('general.documentation')) - ->url('https://docs.speedtest-tracker.dev/', shouldOpenInNewTab: true) - ->icon('heroicon-o-book-open') - ->group(__('general.links')), - NavigationItem::make(__('general.donate')) - ->url('https://github.com/sponsors/alexjustesen', shouldOpenInNewTab: true) - ->icon('heroicon-o-banknotes') - ->group(__('general.links')), - NavigationItem::make(config('speedtest.build_version')) - ->url('https://github.com/alexjustesen/speedtest-tracker', shouldOpenInNewTab: true) - ->icon('tabler-brand-github') - ->badge(fn (): string => Repository::updateAvailable() ? __('general.update_available') : __('general.up_to_date')) - ->group(__('general.links')), ]); } } diff --git a/app/Providers/FilamentServiceProvider.php b/app/Providers/FilamentServiceProvider.php index 1f6b2bd44..99e95cd2e 100644 --- a/app/Providers/FilamentServiceProvider.php +++ b/app/Providers/FilamentServiceProvider.php @@ -24,7 +24,7 @@ public function boot(): void { FilamentView::registerRenderHook( PanelsRenderHook::GLOBAL_SEARCH_BEFORE, - fn (): string => Blade::render("@livewire('topbar.run-speedtest-action')"), + fn (): string => Blade::render("@livewire('topbar.actions')"), ); } } diff --git a/composer.json b/composer.json index 60cca8e29..77cf9452a 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "maennchen/zipstream-php": "^2.4", "promphp/prometheus_client_php": "^2.14.1", "saloonphp/laravel-plugin": "^3.7", - "secondnetwork/blade-tabler-icons": "^3.35.0", + "secondnetwork/blade-tabler-icons": "^3.35", "spatie/laravel-json-api-paginate": "^1.16.3", "spatie/laravel-query-builder": "^6.3.6", "spatie/laravel-settings": "^3.6.0", diff --git a/composer.lock b/composer.lock index b380844bd..23ff73cb5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb6b685d0e7829bbf17c30d67fccb511", + "content-hash": "405d221f03e4de1894ce759a9e751448", "packages": [ { "name": "anourvalar/eloquent-serialize", diff --git a/lang/en/general.php b/lang/en/general.php index dbc2d675f..33c212e21 100644 --- a/lang/en/general.php +++ b/lang/en/general.php @@ -1,6 +1,11 @@ 'Current version', + 'latest_version' => 'Latest version', + 'github' => 'GitHub', + 'repository' => 'Repository', + // Common actions 'save' => 'Save', 'cancel' => 'Cancel', @@ -32,6 +37,8 @@ 'created_at' => 'Created at', 'updated_at' => 'Updated at', 'url' => 'URL', + 'stats' => 'Stats', + 'statistics' => 'Statistics', // Navigation 'dashboard' => 'Dashboard', @@ -42,6 +49,7 @@ 'view_documentation' => 'View documentation', 'links' => 'Links', 'donate' => 'Donate', + 'donations' => 'Donations', // Roles 'admin' => 'Admin', @@ -54,12 +62,15 @@ 'last_month' => 'Last month', // Metrics + 'metrics' => 'Metrics', 'average' => 'Average', 'high' => 'High', 'low' => 'Low', 'faster' => 'faster', 'slower' => 'slower', 'healthy' => 'Healthy', + 'not_measured' => 'Not measured', + 'unhealthy' => 'Unhealthy', // Units 'ms' => 'ms', diff --git a/lang/en/results.php b/lang/en/results.php index 6d8a2016d..65f81386f 100644 --- a/lang/en/results.php +++ b/lang/en/results.php @@ -72,7 +72,6 @@ // Run Speedtest Action 'speedtest' => 'Speedtest', - 'public_dashboard' => 'Public Dashboard', 'select_server' => 'Select Server', 'select_server_helper' => 'Leave empty to run the speedtest without specifying a server. Blocked servers will be skipped.', 'manual_servers' => 'Manual servers', diff --git a/resources/css/app.css b/resources/css/app.css index 54ea6064a..532b718c1 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,4 +1,5 @@ @import 'tailwindcss'; +@import './custom.css'; /* Safelist max-width utilities to always generate them */ @source inline("max-w-{xs,sm,md,lg,xl,2xl,3xl,4xl,5xl,6xl,7xl,full,min,max,fit,prose,screen-sm,screen-md,screen-lg,screen-xl,screen-2xl}"); diff --git a/resources/css/custom.css b/resources/css/custom.css new file mode 100644 index 000000000..465ee0cf8 --- /dev/null +++ b/resources/css/custom.css @@ -0,0 +1,11 @@ +.dashboard-page .fi-section-header { + padding-bottom: 0px; +} + +.dashboard-page .fi-section-header .fi-section-header-heading { + @apply font-medium text-zinc-600 dark:text-zinc-400; +} + +.dashboard-page .fi-section-content-ctn { + border-top: none; +} diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index b39705336..602bc2daa 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -1,4 +1,5 @@ @import '../../../../vendor/filament/filament/resources/css/theme.css'; +@import '../../custom.css'; @source '../../../../app/Filament/**/*'; @source '../../../../resources/views/filament/**/*'; @@ -6,6 +7,7 @@ /* Filament Plugins */ @source '../../../../vendor/codewithdennis/filament-simple-alert/resources/**/*.blade.php'; @source inline('animate-{spin,pulse,bounce}'); +@source inline('{bg,text,border,ring}-{amber,zinc}-{50,100,200,300,400,500,600,700,800,900,950}'); /* Additional styles */ .fi-topbar #dashboardAction .fi-btn-label, diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 8a03ce90c..b3d3762b7 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -1,39 +1,26 @@ -
-
- @livewire(\App\Filament\Widgets\StatsOverviewWidget::class) -
+
+ + + - @isset($latestResult) -
- Latest result: -
- @endisset +
+

+ + Metrics +

-
@livewire(\App\Filament\Widgets\RecentDownloadChartWidget::class) -
-
@livewire(\App\Filament\Widgets\RecentUploadChartWidget::class) -
-
@livewire(\App\Filament\Widgets\RecentPingChartWidget::class) -
-
@livewire(\App\Filament\Widgets\RecentJitterChartWidget::class) -
-
@livewire(\App\Filament\Widgets\RecentDownloadLatencyChartWidget::class) -
-
@livewire(\App\Filament\Widgets\RecentUploadLatencyChartWidget::class)
-
- diff --git a/resources/views/filament/pages/dashboard.blade.php b/resources/views/filament/pages/dashboard.blade.php index f351a1c97..42eb6bbf5 100644 --- a/resources/views/filament/pages/dashboard.blade.php +++ b/resources/views/filament/pages/dashboard.blade.php @@ -1,3 +1,97 @@ - - {{-- Silence is golden --}} + +
+ + + + +
+ + + {{ __('general.documentation') }} + + +
+

Need help getting started or configuring your speedtests?

+
+ +
+ + {{ __('general.view_documentation') }} + +
+
+ + + + {{ __('general.donations') }} + + +
+

Support the development and maintenance of Speedtest Tracker by making a donation.

+
+ +
+ + {{ __('general.donate') }} + +
+
+ + + + {{ __('general.speedtest_tracker') }} + + + @if (\App\Services\GitHub\Repository::updateAvailable()) + + + {{ __('general.update_available') }} + + + @endif + +
    +
  • +

    {{ __('general.current_version') }}

    +

    {{ config('speedtest.build_version') }}

    +
  • + +
  • +

    {{ __('general.latest_version') }}

    +

    {{ \App\Services\GitHub\Repository::getLatestVersion() }}

    +
  • +
+ +
+ + {{ __('general.github') }} {{ str(__('general.repository'))->lower() }} + +
+
+
+
diff --git a/resources/views/livewire/latest-result-stats.blade.php b/resources/views/livewire/latest-result-stats.blade.php new file mode 100644 index 000000000..a8a32bcc7 --- /dev/null +++ b/resources/views/livewire/latest-result-stats.blade.php @@ -0,0 +1,153 @@ +
+ @filled($this->latestResult) +
+
+

+ + Latest result +

+ + + {{ __('general.view') }} + +
+ + + + Benchmark status + + +
+ @if($this->latestResult->healthy === true) +
+
+
+ + {{ __('general.healthy') }} + @elseif($this->latestResult->healthy === false) +
+
+
+ + {{ __('general.unhealthy') }} + @else +
+
+
+ + {{ __('general.not_measured') }} + @endif +
+
+ + + + {{ __('general.download') }} + + + @php + $downloadBenchmark = Arr::get($this->latestResult->benchmarks, 'download'); + $downloadBenchmarkPassed = Arr::get($downloadBenchmark, 'passed', false); + @endphp + + @filled($downloadBenchmark) + + $downloadBenchmarkPassed, + 'text-amber-500 dark:text-amber-400' => ! $downloadBenchmarkPassed, + ]) title="Benchmark {{ $downloadBenchmarkPassed ? 'passed' : 'failed' }}"> + @if (! $downloadBenchmarkPassed) + + @endif + {{ Arr::get($downloadBenchmark, 'value').' '.str(Arr::get($downloadBenchmark, 'unit'))->title() }} + + + @endfilled + +

+ @php + $download = \App\Helpers\Bitrate::formatBits(\App\Helpers\Bitrate::bytesToBits($this->latestResult?->download)); + + $download = explode(' ', $download); + @endphp + + {{ $download[0] }} + {{ $download[1].'ps' }} +

+
+ + + + {{ __('general.upload') }} + + + @php + $uploadBenchmark = Arr::get($this->latestResult->benchmarks, 'upload'); + $uploadBenchmarkPassed = Arr::get($uploadBenchmark, 'passed', false); + @endphp + + @filled($uploadBenchmark) + + $uploadBenchmarkPassed, + 'text-amber-500 dark:text-amber-400' => ! $uploadBenchmarkPassed, + ]) title="Benchmark {{ $uploadBenchmarkPassed ? 'passed' : 'failed' }}"> + @if (! $uploadBenchmarkPassed) + + @endif + {{ Arr::get($uploadBenchmark, 'value').' '.str(Arr::get($uploadBenchmark, 'unit'))->title() }} + + + @endfilled + +

+ @php + $upload = \App\Helpers\Bitrate::formatBits(\App\Helpers\Bitrate::bytesToBits($this->latestResult?->upload)); + + $upload = explode(' ', $upload); + @endphp + + {{ $upload[0] }} + {{ $upload[1].'ps' }} +

+
+ + + + {{ __('general.ping') }} + + + @php + $pingBenchmark = Arr::get($this->latestResult->benchmarks, 'ping'); + $pingBenchmarkPassed = Arr::get($pingBenchmark, 'passed', false); + @endphp + + @filled($pingBenchmark) + + $pingBenchmarkPassed, + 'text-amber-500 dark:text-amber-400' => ! $pingBenchmarkPassed, + ]) title="Benchmark {{ $pingBenchmarkPassed ? 'passed' : 'failed' }}"> + @if (! $pingBenchmarkPassed) + + @endif + {{ Arr::get($pingBenchmark, 'value').' '.str(Arr::get($pingBenchmark, 'unit')) }} + + + @endfilled + +

+ {{ $this->latestResult?->ping }} + ms +

+
+
+ @endfilled +
\ No newline at end of file diff --git a/resources/views/livewire/platform-stats.blade.php b/resources/views/livewire/platform-stats.blade.php new file mode 100644 index 000000000..c9ddfa9c9 --- /dev/null +++ b/resources/views/livewire/platform-stats.blade.php @@ -0,0 +1,68 @@ +
+
+

+ + {{ __('general.statistics') }} +

+ + {{-- +
+

Quota Usage

+ Edit +
+ +
+
+ Bandwidth + 450MB of 1 GB +
+ +
+
+
+
+
--}} + + @filled($this->nextSpeedtest) + + + Next Speedtest in + + +

{{ $this->nextSpeedtest->diffForHumans() }}

+
+ @else + + + Next Speedtest in + + +

No scheduled speedtests

+
+ @endfilled + + + + Total tests + + +

{{ $this->platformStats['total'] }}

+
+ + + + Total successful tests + + +

{{ $this->platformStats['completed'] }}

+
+ + + + Total failed tests + + +

{{ $this->platformStats['failed'] }}

+
+
+
diff --git a/resources/views/livewire/topbar/actions.blade.php b/resources/views/livewire/topbar/actions.blade.php new file mode 100644 index 000000000..b27fb1767 --- /dev/null +++ b/resources/views/livewire/topbar/actions.blade.php @@ -0,0 +1,10 @@ +
+
+ {{ $this->speedtestAction }} + + {{ $this->dashboardAction }} + +
+ + +
diff --git a/resources/views/livewire/topbar/run-speedtest-action.blade.php b/resources/views/livewire/topbar/run-speedtest-action.blade.php deleted file mode 100644 index 3c88447e0..000000000 --- a/resources/views/livewire/topbar/run-speedtest-action.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -
-
- {{ $this->dashboard }} - - {{ $this->speedtestAction }} -
- - -