More Mobile UI

Closes https://github.com/pelican-dev/panel/issues/512
This commit is contained in:
Charles 2024-07-30 12:58:16 -04:00
parent c4864feaa5
commit d22f975684

View File

@ -40,8 +40,8 @@ class CreateServer extends CreateRecord
->icon('tabler-info-circle') ->icon('tabler-info-circle')
->completedIcon('tabler-check') ->completedIcon('tabler-check')
->columns([ ->columns([
'default' => 2, 'default' => 1,
'sm' => 2, 'sm' => 1,
'md' => 4, 'md' => 4,
'lg' => 6, 'lg' => 6,
]) ])
@ -61,7 +61,7 @@ class CreateServer extends CreateRecord
})) }))
->columnSpan([ ->columnSpan([
'default' => 2, 'default' => 2,
'sm' => 4, 'sm' => 3,
'md' => 2, 'md' => 2,
'lg' => 3, 'lg' => 3,
]) ])
@ -75,8 +75,8 @@ class CreateServer extends CreateRecord
->label('Owner') ->label('Owner')
->columnSpan([ ->columnSpan([
'default' => 2, 'default' => 2,
'sm' => 4, 'sm' => 3,
'md' => 2, 'md' => 3,
'lg' => 3, 'lg' => 3,
]) ])
->relationship('user', 'username') ->relationship('user', 'username')
@ -125,10 +125,10 @@ class CreateServer extends CreateRecord
->prefixIcon('tabler-server-2') ->prefixIcon('tabler-server-2')
->default(fn () => ($this->node = Node::query()->latest()->first())?->id) ->default(fn () => ($this->node = Node::query()->latest()->first())?->id)
->columnSpan([ ->columnSpan([
'default' => 1, 'default' => 2,
'sm' => 2, 'sm' => 3,
'md' => 2, 'md' => 6,
'lg' => 2, 'lg' => 6,
]) ])
->live() ->live()
->relationship('node', 'name') ->relationship('node', 'name')
@ -146,10 +146,10 @@ class CreateServer extends CreateRecord
->prefixIcon('tabler-network') ->prefixIcon('tabler-network')
->label('Primary Allocation') ->label('Primary Allocation')
->columnSpan([ ->columnSpan([
'default' => 1, 'default' => 2,
'sm' => 2, 'sm' => 3,
'md' => 1, 'md' => 2,
'lg' => 2, 'lg' => 3,
]) ])
->disabled(fn (Forms\Get $get) => $get('node_id') === null) ->disabled(fn (Forms\Get $get) => $get('node_id') === null)
->searchable(['ip', 'port', 'ip_alias']) ->searchable(['ip', 'port', 'ip_alias'])
@ -268,10 +268,10 @@ class CreateServer extends CreateRecord
Forms\Components\Repeater::make('allocation_additional') Forms\Components\Repeater::make('allocation_additional')
->label('Additional Allocations') ->label('Additional Allocations')
->columnSpan([ ->columnSpan([
'default' => 1, 'default' => 2,
'sm' => 2, 'sm' => 3,
'md' => 1, 'md' => 3,
'lg' => 2, 'lg' => 3,
]) ])
->addActionLabel('Add Allocation') ->addActionLabel('Add Allocation')
->disabled(fn (Forms\Get $get) => $get('allocation_id') === null) ->disabled(fn (Forms\Get $get) => $get('allocation_id') === null)
@ -303,12 +303,13 @@ class CreateServer extends CreateRecord
), ),
), ),
Forms\Components\TextInput::make('description') Forms\Components\TextArea::make('description')
->placeholder('Description') ->placeholder('Description')
->rows(3)
->columnSpan([ ->columnSpan([
'default' => 1, 'default' => 2,
'sm' => 2, 'sm' => 6,
'md' => 2, 'md' => 6,
'lg' => 6, 'lg' => 6,
]) ])
->label('Notes'), ->label('Notes'),
@ -491,12 +492,7 @@ class CreateServer extends CreateRecord
->completedIcon('tabler-check') ->completedIcon('tabler-check')
->schema([ ->schema([
Forms\Components\Fieldset::make('Resource Limits') Forms\Components\Fieldset::make('Resource Limits')
->columnSpan([ ->columnSpan(6)
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
])
->columns([ ->columns([
'default' => 1, 'default' => 1,
'sm' => 2, 'sm' => 2,
@ -676,12 +672,7 @@ class CreateServer extends CreateRecord
Forms\Components\Fieldset::make('Feature Limits') Forms\Components\Fieldset::make('Feature Limits')
->inlineLabel() ->inlineLabel()
->columnSpan([ ->columnSpan(6)
'default' => 2,
'sm' => 4,
'md' => 4,
'lg' => 6,
])
->columns([ ->columns([
'default' => 1, 'default' => 1,
'sm' => 2, 'sm' => 2,
@ -712,18 +703,13 @@ class CreateServer extends CreateRecord
->default(0), ->default(0),
]), ]),
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,
'md' => 3, 'md' => 3,
'lg' => 3, 'lg' => 4,
]) ])
->columnSpan(6)
->schema([ ->schema([
Forms\Components\Select::make('select_image') Forms\Components\Select::make('select_image')
->label('Image Name') ->label('Image Name')
@ -742,7 +728,12 @@ class CreateServer extends CreateRecord
return array_flip($images) + ['ghcr.io/custom-image' => 'Custom Image']; return array_flip($images) + ['ghcr.io/custom-image' => 'Custom Image'];
}) })
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->columnSpan(1), ->columnSpan([
'default' => 1,
'sm' => 2,
'md' => 3,
'lg' => 2,
]),
Forms\Components\TextInput::make('image') Forms\Components\TextInput::make('image')
->label('Image') ->label('Image')
@ -758,13 +749,18 @@ class CreateServer extends CreateRecord
} }
}) })
->placeholder('Enter a custom Image') ->placeholder('Enter a custom Image')
->columnSpan(2), ->columnSpan([
'default' => 1,
'sm' => 2,
'md' => 3,
'lg' => 2,
]),
Forms\Components\KeyValue::make('docker_labels') Forms\Components\KeyValue::make('docker_labels')
->label('Container Labels') ->label('Container Labels')
->keyLabel('Title') ->keyLabel('Title')
->valueLabel('Description') ->valueLabel('Description')
->columnSpan(3), ->columnSpanFull(),
Forms\Components\CheckboxList::make('mounts') Forms\Components\CheckboxList::make('mounts')
->live() ->live()