mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-08 11:19:53 +03:00
Compare commits
2 Commits
main
...
lance/2195
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00897426b3 | ||
|
|
626d6371f7 |
@@ -318,6 +318,7 @@ class EditEgg extends EditRecord
|
||||
->helperText(trans('admin/egg.start_config_help')),
|
||||
Textarea::make('config_files')->rows(10)->json()
|
||||
->label(trans('admin/egg.config_files'))
|
||||
->dehydrateStateUsing(fn ($state) => blank($state) ? '{}' : $state)
|
||||
->helperText(trans('admin/egg.config_files_help')),
|
||||
Textarea::make('config_logs')->rows(10)->json()
|
||||
->label(trans('admin/egg.log_config'))
|
||||
|
||||
@@ -32,10 +32,10 @@ class EggConfigurationService
|
||||
*/
|
||||
public function handle(Server $server): array
|
||||
{
|
||||
$configs = $this->replacePlaceholders(
|
||||
$server,
|
||||
json_decode($server->egg->inherit_config_files)
|
||||
);
|
||||
$configFiles = json_decode($server->egg->inherit_config_files ?? '{}');
|
||||
$configs = is_object($configFiles) || is_array($configFiles)
|
||||
? $this->replacePlaceholders($server, $configFiles)
|
||||
: [];
|
||||
|
||||
return [
|
||||
'startup' => $this->convertStartupToNewFormat(json_decode($server->egg->inherit_config_startup, true)),
|
||||
|
||||
@@ -36,7 +36,7 @@ class EggTransformer extends BaseTransformer
|
||||
{
|
||||
$model->loadMissing('configFrom');
|
||||
|
||||
$files = json_decode($model->inherit_config_files, true, 512, JSON_THROW_ON_ERROR);
|
||||
$files = json_decode($model->inherit_config_files ?: '{}', true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$model->loadMissing('scriptFrom');
|
||||
|
||||
@@ -53,9 +53,9 @@ class EggTransformer extends BaseTransformer
|
||||
'docker_images' => $model->docker_images,
|
||||
'config' => [
|
||||
'files' => $files,
|
||||
'startup' => json_decode($model->inherit_config_startup, true),
|
||||
'startup' => json_decode($model->inherit_config_startup ?: '{}', true),
|
||||
'stop' => $model->inherit_config_stop,
|
||||
'logs' => json_decode($model->inherit_config_logs, true),
|
||||
'logs' => json_decode($model->inherit_config_logs ?: '{}', true),
|
||||
'file_denylist' => $model->inherit_file_denylist,
|
||||
'extends' => $model->config_from,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user