mirror of
https://github.com/pelican-dev/panel.git
synced 2026-07-15 21:48:08 +03:00
fix: Egg edit form not refreshing after import or update (#2358)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
@@ -303,7 +303,11 @@ class EditEgg extends EditRecord
|
|||||||
->tooltip(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use')),
|
->tooltip(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use')),
|
||||||
ExportEggAction::make(),
|
ExportEggAction::make(),
|
||||||
ImportEggAction::make()
|
ImportEggAction::make()
|
||||||
->multiple(false),
|
->multiple(false)
|
||||||
|
->after(function () {
|
||||||
|
$this->record->refresh();
|
||||||
|
$this->refreshForm();
|
||||||
|
}),
|
||||||
Action::make('save')
|
Action::make('save')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->action('save')
|
->action('save')
|
||||||
@@ -316,6 +320,8 @@ class EditEgg extends EditRecord
|
|||||||
public function refreshForm(): void
|
public function refreshForm(): void
|
||||||
{
|
{
|
||||||
$this->fillForm();
|
$this->fillForm();
|
||||||
|
|
||||||
|
$this->dispatch('setContent', content: $this->record->script_install ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFormActions(): array
|
protected function getFormActions(): array
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ class EggImporterService
|
|||||||
'uuid' => $uuid,
|
'uuid' => $uuid,
|
||||||
'author' => Arr::get($parsed, 'author'),
|
'author' => Arr::get($parsed, 'author'),
|
||||||
'copy_script_from' => null,
|
'copy_script_from' => null,
|
||||||
|
'config_from' => null,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
for ($i = 0; $i < count($parsed['variables']); $i++) {
|
for ($i = 0; $i < count($parsed['variables']); $i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user