From 8ae76c38890f762247a8e32a78fa97267798246e Mon Sep 17 00:00:00 2001 From: Dawid Jaworski Date: Sat, 29 Jun 2024 20:59:05 +0200 Subject: [PATCH] feat: add egg features editor in Admin UI (#5130) --- app/Http/Requests/Admin/Egg/EggFormRequest.php | 2 ++ resources/views/admin/eggs/new.blade.php | 13 +++++++++++++ resources/views/admin/eggs/view.blade.php | 16 ++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/app/Http/Requests/Admin/Egg/EggFormRequest.php b/app/Http/Requests/Admin/Egg/EggFormRequest.php index a53b9c91b8..561ffb7978 100644 --- a/app/Http/Requests/Admin/Egg/EggFormRequest.php +++ b/app/Http/Requests/Admin/Egg/EggFormRequest.php @@ -14,6 +14,7 @@ public function rules(): array 'docker_images' => ['required', 'string', 'regex:/^[\w#\.\/\- ]*\|?~?[\w\.\/\-:@ ]*$/im'], 'force_outgoing_ip' => 'sometimes|boolean', 'file_denylist' => 'array', + 'features' => 'sometimes|array', 'startup' => 'required|string', 'config_from' => 'sometimes|bail|nullable|numeric', 'config_stop' => 'required_without:config_from|nullable|string|max:191', @@ -42,6 +43,7 @@ public function validated($key = null, $default = null): array return array_merge($data, [ 'force_outgoing_ip' => array_get($data, 'force_outgoing_ip', false), + 'features' => array_get($data, 'features', []), ]); } } diff --git a/resources/views/admin/eggs/new.blade.php b/resources/views/admin/eggs/new.blade.php index 9a0a07849e..7f77fec9a7 100644 --- a/resources/views/admin/eggs/new.blade.php +++ b/resources/views/admin/eggs/new.blade.php @@ -72,6 +72,14 @@

The default startup command that should be used for new servers created with this Egg. You can change this per-server as needed.

+
+ +
+ +

Additional features belonging to the egg. Useful for configuring additional panel modifications.

+
+
@@ -161,5 +169,10 @@ $(this).val(prepend + ' ' + append); } }); + $('#pConfigFeatures').select2({ + tags: true, + selectOnClose: false, + tokenSeparators: [',', ' '], + }); @endsection diff --git a/resources/views/admin/eggs/view.blade.php b/resources/views/admin/eggs/view.blade.php index b999d2a910..50b69c3793 100644 --- a/resources/views/admin/eggs/view.blade.php +++ b/resources/views/admin/eggs/view.blade.php @@ -114,6 +114,17 @@

The default startup command that should be used for new servers using this Egg.

+
+ +
+ +

Additional features belonging to the egg. Useful for configuring additional panel modifications.

+
+
@@ -202,5 +213,10 @@ $(this).val(prepend + ' ' + append); } }); + $('#pConfigFeatures').select2({ + tags: true, + selectOnClose: false, + tokenSeparators: [',', ' '], + }); @endsection