Skip to content

Commit

Permalink
Use helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
lancepioch committed Jan 4, 2025
1 parent d081ba4 commit 5daaaf7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/Filament/Server/Pages/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,14 @@ public function form(Form $form): Form
->prefixIcon('tabler-device-desktop-analytics')
->columnSpan(1)
->disabled()
->formatStateUsing(fn ($state, Server $server) => !$state ? 'Unlimited' : (config('panel.use_binary_prefix')
? Number::format($server->memory / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($server->memory / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB')),
->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' : (config('panel.use_binary_prefix')
? Number::format($server->disk / 1024, maxPrecision: 2, locale: auth()->user()->language) .' GiB'
: Number::format($server->disk / 1000, maxPrecision: 2, locale: auth()->user()->language) . ' GB')),
->formatStateUsing(fn ($state, Server $server) => !$state ? 'Unlimited' : convert_bytes_to_readable($server->disk * 2 ** 20)),
TextInput::make('backup_limit')
->label('')
->prefix('Backups')
Expand Down

0 comments on commit 5daaaf7

Please sign in to comment.