diff --git a/app/Filament/Server/Pages/Settings.php b/app/Filament/Server/Pages/Settings.php index dab7cce34..36afc5eff 100644 --- a/app/Filament/Server/Pages/Settings.php +++ b/app/Filament/Server/Pages/Settings.php @@ -20,6 +20,7 @@ use Filament\Notifications\Notification; use Filament\Support\Enums\Alignment; use GuzzleHttp\Exception\TransferException; use Illuminate\Support\Facades\Http; +use Illuminate\Support\Number; class Settings extends ServerFormPage { @@ -99,21 +100,48 @@ class Settings extends ServerFormPage 'lg' => 3, ]) ->schema([ + TextInput::make('cpu') + ->label('') + ->prefix('CPU') + ->prefixIcon('tabler-cpu') + ->columnSpan(1) + ->disabled() + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'Unlimited' : Number::format($server->cpu, locale: auth()->user()->language) . '%'), + TextInput::make('memory') + ->label('') + ->prefix('Memory') + ->prefixIcon('tabler-device-desktop-analytics') + ->columnSpan(1) + ->disabled() + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'Unlimited' : convert_bytes_to_readable($server->memory * 2 ** 20)), + TextInput::make('disk') + ->label('') + ->prefix('Disk Space') + ->prefixIcon('tabler-device-sd-card') + ->columnSpan(1) + ->disabled() + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'Unlimited' : convert_bytes_to_readable($server->disk * 2 ** 20)), TextInput::make('backup_limit') - ->label('Backup Limit') + ->label('') + ->prefix('Backups') + ->prefixIcon('tabler-file-zip') ->columnSpan(1) ->disabled() - ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No Backups can be created' : $server->backups->count() . ' of ' . $state), + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No Backups' : $server->backups->count() . ' of ' . $state), TextInput::make('database_limit') - ->label('Database Limit') + ->label('') + ->prefix('Databases') + ->prefixIcon('tabler-database') ->columnSpan(1) ->disabled() - ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No Databases can be created' : $server->databases->count() . ' of ' . $state), + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No Databases' : $server->databases->count() . ' of ' . $state), TextInput::make('allocation_limit') - ->label('Allocation Limit') + ->label('') + ->prefix('Allocations') + ->prefixIcon('tabler-network') ->columnSpan(1) ->disabled() - ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No additional Allocations can be created' : $server->allocations->count() . ' of ' . $state), + ->formatStateUsing(fn ($state, Server $server) => !$state ? 'No Additional Allocations' : $server->allocations->count() . ' of ' . $state), ]), ]), Section::make('Node Information')