mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 13:14:45 +02:00
fix schedules
This commit is contained in:
parent
7c32cdcebb
commit
8359cc6f1c
@ -89,20 +89,21 @@ class ScheduleResource extends Resource
|
||||
->placeholder('A human readable identifier for this schedule.')
|
||||
->autocomplete(false)
|
||||
->required(),
|
||||
ToggleButtons::make('Status')
|
||||
->visibleOn(Operation::Edit)
|
||||
->formatStateUsing(fn (Schedule $schedule) => !$schedule->is_active ? 'inactive' : ($schedule->is_processing ? 'processing' : 'active'))
|
||||
->options(fn (Schedule $schedule) => !$schedule->is_active ? ['inactive' => 'Inactive'] : ($schedule->is_processing ? ['processing' => 'Processing'] : ['active' => 'Active']))
|
||||
->colors([
|
||||
'inactive' => 'danger',
|
||||
'processing' => 'warning',
|
||||
'active' => 'success',
|
||||
])
|
||||
->columnSpan([
|
||||
'default' => 4,
|
||||
'md' => 1,
|
||||
'lg' => 1,
|
||||
]),
|
||||
// TODO conditional ->hiddenOn, ->visibleOn appear broken?
|
||||
// ToggleButtons::make('Status')
|
||||
// ->hiddenOn(Operation::Create)
|
||||
// ->formatStateUsing(fn (Schedule $schedule) => !$schedule->is_active ? 'inactive' : ($schedule->is_processing ? 'processing' : 'active'))
|
||||
// ->options(fn (Schedule $schedule) => !$schedule->is_active ? ['inactive' => 'Inactive'] : ($schedule->is_processing ? ['processing' => 'Processing'] : ['active' => 'Active']))
|
||||
// ->colors([
|
||||
// 'inactive' => 'danger',
|
||||
// 'processing' => 'warning',
|
||||
// 'active' => 'success',
|
||||
// ])
|
||||
// ->columnSpan([
|
||||
// 'default' => 4,
|
||||
// 'md' => 1,
|
||||
// 'lg' => 1,
|
||||
// ]),
|
||||
Toggle::make('only_when_online')
|
||||
->label('Only when Server is Online?')
|
||||
->hintIconTooltip('Only execute this schedule when the server is in a running state.')
|
||||
@ -168,6 +169,7 @@ class ScheduleResource extends Resource
|
||||
Section::make('Presets')
|
||||
->hiddenOn('view')
|
||||
->columns(1)
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Actions::make([
|
||||
Action::make('hourly')
|
||||
|
Loading…
x
Reference in New Issue
Block a user