Skip to content

Commit

Permalink
Merge pull request #481 from andreapollastri/4.x
Browse files Browse the repository at this point in the history
Dashboard Review
  • Loading branch information
andreapollastri committed Mar 17, 2024
2 parents da41aa9 + ebdf606 commit 0ed6117
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/Filament/Widgets/StatsOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class StatsOverview extends BaseWidget
{
protected static ?string $pollingInterval = '45s';

protected function getColumns(): int
{
return 2;
}

protected function getStats(): array
{
$stats = StatModel::latest()->first();
Expand All @@ -23,9 +28,6 @@ protected function getStats(): array
Stat::make('Name', config('panel.serverName'))
->description('Server name')
->descriptionIcon('heroicon-m-rocket-launch'),
Stat::make('Sites', Site::count())
->description('Hosted sites')
->descriptionIcon('heroicon-m-computer-desktop'),
Stat::make('CPU', (isset($stats->cpu)) ? $stats->cpu.'%' : '0'.'%')
->description('CPU usage')
->descriptionIcon('heroicon-m-cpu-chip')
Expand All @@ -34,6 +36,9 @@ protected function getStats(): array
->description('RAM usage')
->descriptionIcon('heroicon-m-rectangle-stack')
->chart($chart->pluck('ram')->reverse()->toArray()),
Stat::make('Sites', Site::count())
->description('Hosted sites')
->descriptionIcon('heroicon-m-computer-desktop'),
Stat::make('HDD', (isset($stats->hdd)) ? $stats->hdd : '0%')
->description('HDD usage')
->descriptionIcon('heroicon-m-server'),
Expand Down

0 comments on commit 0ed6117

Please sign in to comment.