mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00
Pint & Add application features to create page
This commit is contained in:
parent
607e186082
commit
dfe2e9d629
@ -31,11 +31,11 @@ class EditNode extends EditRecord
|
||||
Tabs\Tab::make('Basic Settings')
|
||||
->icon('tabler-server')
|
||||
->schema((new CreateNode())->form($form)->getComponents()),
|
||||
Tabs\Tab::make('Advanced Settings')
|
||||
->icon('tabler-server-cog')
|
||||
->schema([
|
||||
Forms\Components\Placeholder::make('Coming soon!'),
|
||||
]),
|
||||
// Tabs\Tab::make('Advanced Settings')
|
||||
// ->icon('tabler-server-cog')
|
||||
// ->schema([
|
||||
// Forms\Components\Placeholder::make('Coming soon!'),
|
||||
// ]),
|
||||
Tabs\Tab::make('Configuration')
|
||||
->icon('tabler-code')
|
||||
->schema([
|
||||
|
@ -353,39 +353,6 @@ class CreateServer extends CreateRecord
|
||||
'lg' => 3,
|
||||
]),
|
||||
|
||||
Forms\Components\Fieldset::make('Application Feature Limits')
|
||||
->inlineLabel()
|
||||
->hiddenOn('create')
|
||||
->columnSpan([
|
||||
'default' => 2,
|
||||
'sm' => 4,
|
||||
'md' => 4,
|
||||
'lg' => 6,
|
||||
])
|
||||
->columns([
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 3,
|
||||
])
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('allocation_limit')
|
||||
->suffixIcon('tabler-network')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
Forms\Components\TextInput::make('database_limit')
|
||||
->suffixIcon('tabler-database')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
Forms\Components\TextInput::make('backup_limit')
|
||||
->suffixIcon('tabler-copy-check')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
]),
|
||||
|
||||
Forms\Components\Textarea::make('startup')
|
||||
->hintIcon('tabler-code')
|
||||
->label('Startup Command')
|
||||
@ -634,18 +601,58 @@ class CreateServer extends CreateRecord
|
||||
->label('Block IO Proportion')
|
||||
->default(500),
|
||||
|
||||
Forms\Components\ToggleButtons::make('oom_disabled')
|
||||
->label('OOM Killer')
|
||||
->inlineLabel()->inline()
|
||||
->default(false)
|
||||
->columnSpan(2)
|
||||
->options([
|
||||
false => 'Disabled',
|
||||
true => 'Enabled',
|
||||
Forms\Components\Grid::make()
|
||||
->columns(4)
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Forms\Components\ToggleButtons::make('oom_disabled')
|
||||
->label('OOM Killer')
|
||||
->inlineLabel()->inline()
|
||||
->default(false)
|
||||
->columnSpan(2)
|
||||
->options([
|
||||
false => 'Disabled',
|
||||
true => 'Enabled',
|
||||
])
|
||||
->colors([
|
||||
false => 'success',
|
||||
true => 'danger',
|
||||
]),
|
||||
|
||||
Forms\Components\TextInput::make('oom_disabled_hidden')
|
||||
->hidden(),
|
||||
]),
|
||||
|
||||
Forms\Components\Fieldset::make('Application Feature Limits')
|
||||
->inlineLabel()
|
||||
->columnSpan([
|
||||
'default' => 2,
|
||||
'sm' => 4,
|
||||
'md' => 4,
|
||||
'lg' => 6,
|
||||
])
|
||||
->colors([
|
||||
false => 'success',
|
||||
true => 'danger',
|
||||
->columns([
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 3,
|
||||
])
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('allocation_limit')
|
||||
->suffixIcon('tabler-network')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
Forms\Components\TextInput::make('database_limit')
|
||||
->suffixIcon('tabler-database')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
Forms\Components\TextInput::make('backup_limit')
|
||||
->suffixIcon('tabler-copy-check')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
|
@ -32,8 +32,7 @@ class EditServer extends EditRecord
|
||||
])
|
||||
->schema([
|
||||
Forms\Components\ToggleButtons::make('docker')
|
||||
->label('Container Status')
|
||||
->inlineLabel()
|
||||
->label('Container Status')->inline()->inlineLabel()
|
||||
->formatStateUsing(function ($state, Server $server) {
|
||||
if ($server->node_id === null) {
|
||||
return 'unknown';
|
||||
@ -59,13 +58,12 @@ class EditServer extends EditRecord
|
||||
'sm' => 2,
|
||||
'md' => 2,
|
||||
'lg' => 3,
|
||||
])
|
||||
->inline(),
|
||||
]),
|
||||
|
||||
Forms\Components\ToggleButtons::make('status')
|
||||
->label('Server State')
|
||||
->label('Server State')->inline()->inlineLabel()
|
||||
->helperText('')
|
||||
->inlineLabel()
|
||||
|
||||
->formatStateUsing(fn ($state) => $state ?? ServerState::Normal)
|
||||
->options(fn ($state) => collect(ServerState::cases())->filter(fn ($serverState) => $serverState->value === $state)->mapWithKeys(
|
||||
fn (ServerState $state) => [$state->value => str($state->value)->replace('_', ' ')->ucwords()]
|
||||
@ -81,8 +79,7 @@ class EditServer extends EditRecord
|
||||
'sm' => 2,
|
||||
'md' => 2,
|
||||
'lg' => 3,
|
||||
])
|
||||
->inline(),
|
||||
]),
|
||||
|
||||
Forms\Components\TextInput::make('external_id')
|
||||
->maxLength(191)
|
||||
@ -142,7 +139,7 @@ class EditServer extends EditRecord
|
||||
->required(),
|
||||
|
||||
Forms\Components\ToggleButtons::make('skip_scripts')
|
||||
->label('Run Egg Install Script?')
|
||||
->label('Run Egg Install Script?')->inline()
|
||||
->options([
|
||||
false => 'Yes',
|
||||
true => 'Skip',
|
||||
@ -155,12 +152,11 @@ class EditServer extends EditRecord
|
||||
false => 'tabler-code',
|
||||
true => 'tabler-code-off',
|
||||
])
|
||||
->inline()
|
||||
->required(),
|
||||
|
||||
Forms\Components\ToggleButtons::make('custom_image')
|
||||
->live()
|
||||
->label('Custom Image?')
|
||||
->label('Custom Image?')->inline()
|
||||
->formatStateUsing(function ($state, Forms\Get $get) {
|
||||
if ($state !== null) {
|
||||
return $state;
|
||||
@ -181,8 +177,7 @@ class EditServer extends EditRecord
|
||||
->icons([
|
||||
false => 'tabler-settings-cancel',
|
||||
true => 'tabler-settings-check',
|
||||
])
|
||||
->inline(),
|
||||
]),
|
||||
|
||||
Forms\Components\TextInput::make('image')
|
||||
->hidden(fn (Forms\Get $get) => !$get('custom_image'))
|
||||
@ -213,35 +208,6 @@ class EditServer extends EditRecord
|
||||
])
|
||||
->required(),
|
||||
|
||||
Forms\Components\Fieldset::make('Application Feature Limits')
|
||||
->inlineLabel()
|
||||
->columnSpan([
|
||||
'default' => 2,
|
||||
'sm' => 4,
|
||||
'md' => 4,
|
||||
'lg' => 6,
|
||||
])
|
||||
->columns([
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 3,
|
||||
])
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('allocation_limit')
|
||||
->suffixIcon('tabler-network')
|
||||
->required()
|
||||
->numeric(),
|
||||
Forms\Components\TextInput::make('database_limit')
|
||||
->suffixIcon('tabler-database')
|
||||
->required()
|
||||
->numeric(),
|
||||
Forms\Components\TextInput::make('backup_limit')
|
||||
->suffixIcon('tabler-copy-check')
|
||||
->required()
|
||||
->numeric(),
|
||||
]),
|
||||
|
||||
Forms\Components\Textarea::make('startup')
|
||||
->hintIcon('tabler-code')
|
||||
->label('Startup Command')
|
||||
@ -459,16 +425,53 @@ class EditServer extends EditRecord
|
||||
->helperText('The IO performance relative to other running containers')
|
||||
->label('Block IO Proportion'),
|
||||
|
||||
Forms\Components\ToggleButtons::make('oom_disabled')
|
||||
->label('OOM Killer')->inlineLabel()->inline()
|
||||
->columnSpan(2)
|
||||
->options([
|
||||
false => 'Disabled',
|
||||
true => 'Enabled',
|
||||
Forms\Components\Grid::make()
|
||||
->columns(4)
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Forms\Components\ToggleButtons::make('oom_disabled')
|
||||
->label('OOM Killer')->inlineLabel()->inline()
|
||||
->columnSpan(2)
|
||||
->options([
|
||||
false => 'Disabled',
|
||||
true => 'Enabled',
|
||||
])
|
||||
->colors([
|
||||
false => 'success',
|
||||
true => 'danger',
|
||||
]),
|
||||
|
||||
Forms\Components\TextInput::make('oom_disabled_hidden')
|
||||
->hidden(),
|
||||
]),
|
||||
|
||||
Forms\Components\Fieldset::make('Application Feature Limits')
|
||||
->inlineLabel()
|
||||
->columnSpan([
|
||||
'default' => 2,
|
||||
'sm' => 4,
|
||||
'md' => 4,
|
||||
'lg' => 6,
|
||||
])
|
||||
->colors([
|
||||
false => 'success',
|
||||
true => 'danger',
|
||||
->columns([
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 3,
|
||||
])
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('allocation_limit')
|
||||
->suffixIcon('tabler-network')
|
||||
->required()
|
||||
->numeric(),
|
||||
Forms\Components\TextInput::make('database_limit')
|
||||
->suffixIcon('tabler-database')
|
||||
->required()
|
||||
->numeric(),
|
||||
Forms\Components\TextInput::make('backup_limit')
|
||||
->suffixIcon('tabler-copy-check')
|
||||
->required()
|
||||
->numeric(),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
|
@ -52,7 +52,7 @@ class AdminPanelProvider extends PanelProvider
|
||||
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
|
||||
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
|
||||
->discoverClusters(in: app_path('Filament/Clusters'), for: 'App\\Filament\\Clusters')
|
||||
->pages([
|
||||
->pages([
|
||||
// Pages\Dashboard::class,
|
||||
])
|
||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
||||
|
Loading…
x
Reference in New Issue
Block a user