Layout fix for mobile

This commit is contained in:
Charles 2024-07-30 10:43:24 -04:00
parent a58e159478
commit 686c4375bc

View File

@ -7,6 +7,8 @@ use App\Services\Databases\DatabaseManagementService;
use App\Services\Databases\DatabasePasswordService; use App\Services\Databases\DatabasePasswordService;
use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Repeater;
use Filament\Forms\Get;
use Filament\Forms\Set;
use LogicException; use LogicException;
use App\Filament\Resources\ServerResource; use App\Filament\Resources\ServerResource;
use App\Http\Controllers\Admin\ServersController; use App\Http\Controllers\Admin\ServersController;
@ -36,22 +38,16 @@ class EditServer extends EditRecord
public function form(Form $form): Form public function form(Form $form): Form
{ {
return $form return $form
->columns([
'default' => 1,
'sm' => 2,
'md' => 2,
'lg' => 4,
])
->schema([ ->schema([
Tabs::make('Tabs') Tabs::make('Tabs')
->persistTabInQueryString() ->persistTabInQueryString()
->columnSpan(6)
->columns([ ->columns([
'default' => 2, 'default' => 2,
'sm' => 2, 'sm' => 2,
'md' => 4, 'md' => 4,
'lg' => 6, 'lg' => 6,
]) ])
->columnSpanFull()
->tabs([ ->tabs([
Tabs\Tab::make('Information') Tabs\Tab::make('Information')
->icon('tabler-info-circle') ->icon('tabler-info-circle')
@ -161,12 +157,6 @@ class EditServer extends EditRecord
->icon('tabler-brand-docker') ->icon('tabler-brand-docker')
->schema([ ->schema([
Forms\Components\Fieldset::make('Resource Limits') Forms\Components\Fieldset::make('Resource Limits')
->columnSpan([
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
])
->columns([ ->columns([
'default' => 1, 'default' => 1,
'sm' => 2, 'sm' => 2,
@ -342,12 +332,6 @@ class EditServer extends EditRecord
Forms\Components\Fieldset::make('Feature Limits') Forms\Components\Fieldset::make('Feature Limits')
->inlineLabel() ->inlineLabel()
->columnSpan([
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
])
->columns([ ->columns([
'default' => 1, 'default' => 1,
'sm' => 2, 'sm' => 2,
@ -372,12 +356,6 @@ class EditServer extends EditRecord
->numeric(), ->numeric(),
]), ]),
Forms\Components\Fieldset::make('Docker Settings') Forms\Components\Fieldset::make('Docker Settings')
->columnSpan([
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
])
->columns([ ->columns([
'default' => 1, 'default' => 1,
'sm' => 2, 'sm' => 2,
@ -440,10 +418,10 @@ class EditServer extends EditRecord
->disabledOn('edit') ->disabledOn('edit')
->prefixIcon('tabler-egg') ->prefixIcon('tabler-egg')
->columnSpan([ ->columnSpan([
'default' => 1, 'default' => 6,
'sm' => 3, 'sm' => 3,
'md' => 3, 'md' => 3,
'lg' => 5, 'lg' => 4,
]) ])
->relationship('egg', 'name') ->relationship('egg', 'name')
->searchable() ->searchable()
@ -452,6 +430,12 @@ class EditServer extends EditRecord
Forms\Components\ToggleButtons::make('skip_scripts') Forms\Components\ToggleButtons::make('skip_scripts')
->label('Run Egg Install Script?')->inline() ->label('Run Egg Install Script?')->inline()
->columnSpan([
'default' => 6,
'sm' => 1,
'md' => 1,
'lg' => 2,
])
->options([ ->options([
false => 'Yes', false => 'Yes',
true => 'Skip', true => 'Skip',
@ -469,12 +453,9 @@ class EditServer extends EditRecord
Forms\Components\Textarea::make('startup') Forms\Components\Textarea::make('startup')
->label('Startup Command') ->label('Startup Command')
->required() ->required()
->columnSpan([ ->hint('sdfa')
'default' => 2, ->hintIcon('tabler-code')
'sm' => 4, ->columnSpan(6)
'md' => 4,
'lg' => 6,
])
->rows(function ($state) { ->rows(function ($state) {
return str($state)->explode("\n")->reduce( return str($state)->explode("\n")->reduce(
fn (int $carry, $line) => $carry + floor(strlen($line) / 125), fn (int $carry, $line) => $carry + floor(strlen($line) / 125),
@ -486,17 +467,12 @@ class EditServer extends EditRecord
->hintAction(CopyAction::make()) ->hintAction(CopyAction::make())
->label('Default Startup Command') ->label('Default Startup Command')
->disabled() ->disabled()
->formatStateUsing(function ($state, Forms\Get $get, Forms\Set $set) { ->formatStateUsing(function ($state, Get $get, Set $set) {
$egg = Egg::query()->find($get('egg_id')); $egg = Egg::query()->find($get('egg_id'));
return $egg->startup; return $egg->startup;
}) })
->columnSpan([ ->columnSpan(6),
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
]),
Forms\Components\Repeater::make('server_variables') Forms\Components\Repeater::make('server_variables')
->relationship('serverVariables') ->relationship('serverVariables')