mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 15:40:25 +00:00
40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Widgets;
|
|
|
|
use App\Models\Customer;
|
|
use App\Models\Domain;
|
|
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
|
|
use Filament\Widgets\StatsOverviewWidget\Stat;
|
|
|
|
class CustomersCount extends BaseWidget
|
|
{
|
|
protected static bool $isLazy = false;
|
|
|
|
protected static ?int $sort = 4;
|
|
|
|
protected function getStats(): array
|
|
{
|
|
|
|
// $serverStatistic = new \App\Statistics\ServerStatistic();
|
|
// $serverStats = $serverStatistic->getCurrentStats();
|
|
|
|
$customersCount = Customer::count();
|
|
$websiteCount = Domain::count();
|
|
|
|
return [
|
|
// Stat::make('Total Memory', $serverStats['memory']['total']),
|
|
// Stat::make('Used Memory', $serverStats['memory']['used']),
|
|
// Stat::make('Free Memory', $serverStats['memory']['free']),
|
|
// Stat::make('Shared Memory', $serverStats['memory']['shared']),
|
|
// Stat::make('Buffer Cache', $serverStats['memory']['buffCache']),
|
|
// Stat::make('Available Memory', $serverStats['memory']['available']),
|
|
//
|
|
|
|
Stat::make('Websites', $websiteCount)->icon('heroicon-o-globe-alt'),
|
|
Stat::make('Customers', $customersCount)->icon('heroicon-o-users'),
|
|
Stat::make('Active Customers', $customersCount)->icon('heroicon-o-user-group'),
|
|
Stat::make('Inactive Customers', 0)->icon('heroicon-o-user-minus'),
|
|
];
|
|
}
|
|
}
|