Commit Graph
508 Commits
Author SHA1 Message Date
Sky Mulleyandrobert dennis 71dd1911a5 Implement native support for hooking into forms with extensions (#7256)
## Problem

Extensions can render content before and after most admin pages, but not
inside the forms on them. The only exception was
`panel.users.detail.form`, and it could only re-render or validate the
user's existing fields. An extension had no way to add a field of its
own, because the Panel's save requests had nowhere to carry the value
and nothing loaded it back.

## Changes

### Slots inside every admin form

The create and edit forms for users, nodes, servers, eggs, locations,
mounts and database hosts each render a slot inside the form, such as
`panel.servers.create.form` and `panel.servers.detail.details.form`. The
slot receives the native `form`, the form's `kind` (`admin.server`), and
`mode` (`'create'` or `'edit'`). Edit slots also receive the saved
`resource`. Contributed `form.AppField` controls share the form's
validation, pending state and submit action.

### Extension-owned fields

An extension registers fields in its provider:

```php
$this->registerFormFields('admin.user', ['plan' => ['required', 'in:free,pro']]);

$this->registerFormFields(
    'admin.node',
    ['region' => ['required', 'string', 'max:32']],
    fn (Node $node): array => ['region' => NodeRegion::for($node)],
    fn (Node $node, array $values) => NodeRegion::store($node, $values['region']),
);
```

The 14 create and update endpoints accept an optional `extensions: {
[extensionId]: { [field]: value } }` body field. Each extension's rules
are applied as `extensions.{id}.{field}`, and only when the request
includes that extension's values. The extension's `save` callback runs
in the same database transaction as the core change, so a failure rolls
both back.

Server creation is the exception. Wings reads the new server while
provisioning it, so extension values are saved after provisioning
succeeds, outside the transaction.

For Node updates when Wings is unreachable. `UpdateNode` saves the node
and then throws `ConfigurationNotPersistedException` as a warning. The
node controller defers that exception until the extension values are
saved, so the node update is no longer rolled back.

`GET /api/admin/extensions/forms/{form}/{id}` returns every extension's
current values. It requires the resource's read permission. Edit pages
fetch it before rendering the form, but only when an extension has
registered fields for that form; the bootstrap payload now lists them
per extension in `forms`.

For users and servers the callbacks are optional, and values are stored
in the extension's scoped settings (`settings()->forUser($user)`,
`forServer($server)`). Values are limited to strings, numbers, booleans,
`null`, or lists of strings and numbers, which keeps the OpenAPI schema
and generated types concrete.

A `load` callback that throws, or returns an invalid value, is recorded
against the extension in the `form` phase. The frontend then hides that
extension's slot contributions on the edit page, so a save cannot
overwrite its stored values with defaults. Fields of a disabled or
failed extension are neither validated, saved nor loaded.

---------

Co-authored-by: robert dennis <31261583+robertdrakedennis@users.noreply.github.com>
2026-10-09 01:26:45 -04:00
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00
Red Banana 760c3db300 Adding java 25 to MC eggs (#5617)
Adding java 25 to the MC eggs, as needed for the newest versions.
2026-04-05 20:21:26 +02:00
Daniel Barton c8a5bf576b Egg: (Paper) Update install script and add Java 25 (#5606)
Update paper egg to use new fill API and add Java 25
2026-03-30 23:35:46 +08:00
Carlton 33695c642d Fix transfer status permission checks (#5573) 2026-03-26 16:53:41 -07:00
Gio 3dd206ccf7 Clear allocation notes on server deletion (#5157) 2026-01-04 16:44:46 -08:00
Alan Escarcha ace4c025e9 Update Docker container for Forge installation script (#5424) 2026-01-04 15:49:24 -08:00
Dane Everitt 032bf076d9 Ensure that TOTP tokens cannot be reused (#5481) 2025-12-30 12:27:11 -08:00
Dane Everitt 895adb6e6f Ensure that a node description can be set, add additional test coverage (#5457) 2025-12-24 16:43:00 -08:00
Red Banana 043c02c69c eggs: update Ark Survival Evolved (#5361) 2025-06-12 11:55:25 -06:00
Matthew Penner d1dd5b1f02 fix: db schema dump not importing on older MariaDB versions
Signed-off-by: Matthew Penner <me@matthewp.io>
2025-02-14 13:20:40 -07:00
Matthew Penner 8ca098940a chore: update composer dependencies (#5198)
Signed-off-by: Matthew Penner <me@matthewp.io>
2024-10-21 19:18:20 -06:00
Matthew Penner f9efaa86b1 chore: add laravel database schema dump
Signed-off-by: Matthew Penner <me@matthewp.io>
2024-10-21 17:21:12 -06:00
Daniel BartonandPanda260 2611cdf426 egg(teamspeak): add server admin password variable (#5099)
Co-authored-by: Panda260 <Panda260@NeverStopGaming.net>
2024-06-29 12:24:43 -06:00
Daniel Barton 049ad838e3 egg(minecraft): add Java 21 to image list (#5093) 2024-05-07 21:52:33 -06:00
Matthew Penner 341eda7855 egg(rust): change ordering of mod frameworks 2023-10-20 19:29:21 -06:00
Matthew Penner a62e8b1a67 egg(rust): use yolk image instead of the deprecated one 2023-10-12 13:54:42 -06:00
Matthew Penner 29783ed240 egg(rust): add support for Carbon
Rebased version of #4734 to 1.0-develop
2023-07-11 20:37:14 -06:00
Matthew Penner 1d38b4f0e2 Laravel 10 (#4706) 2023-02-23 12:30:16 -07:00
Alex 9b47403e00 egg(rust): add server.queryport option (#4681) 2023-02-04 14:42:04 -07:00
Matthew Penner 20f23a0b27 db: add uuid column to failed_jobs table
Refer to
<https://laravel.com/docs/8.x/upgrade#failed-jobs-table-batch-support>
for more information regarding this change.

Closes #4652
2023-01-24 14:02:41 -07:00
Matthew Penner 428311e854 database: fix mail settings migration 2022-12-12 15:47:48 -07:00
Matthew Penner 6df31e1923 database: fix migration transaction failure? 2022-12-12 15:26:47 -07:00
Matthew Penner c8c648f0e5 php-cs-fixer 2022-12-12 15:14:37 -07:00
Matthew Penner 0751eeec97 database: add migration for new mail config keys 2022-12-12 15:12:03 -07:00
Wunderharke c8f7bdf9cb egg(teamspeak): fix database support (#4513) 2022-11-28 12:04:56 -07:00
TaktischerSpeck 75f36839df egg(teamspeak): port and argument updates (#4546) 2022-11-28 11:59:48 -07:00
Alex c068f57e4e fix(forge): validate only input and not length (#4528)
Only allows digits, dots and dashes in the input, which is what Forge versions consists of. Removes arbitrary char limit.
2022-11-06 15:15:12 -07:00
Quinten e21aab2537 Update mumble egg (#4437) 2022-10-31 10:29:29 -06:00
Matthew PennerandDaneEveritt cbcf62086f Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00
Matthew Penner 68e9100e57 admin(eggs): add force_outgoing_ip option (#4323)
Closes #3841
2022-09-25 13:24:54 -06:00
Matthew Penner 8e1a21563e server: add configuration for install notifications (#4331)
* server: track `installed_at`, only send install notification on first install
* server: add configuration for install notifications
2022-09-25 13:16:58 -06:00
Argonaut Network 9bcf90db93 Fix grammatical error (#4138) 2022-06-26 21:17:02 -04:00
Torsten Widmann 8f2defc6f8 add new map to description (#4142) 2022-06-26 21:16:39 -04:00
Alex 3339a316ca feat: use max percentage instead of xmx (#4146)
Replaces Xmx with a percentage-based argument, in this case leaving 5% overhead.

Resolves issue of container OOM/freezing when all memory is allocated to the java application or when users attempt to use unlimited memory of 0. That's because all the allocated memory is set to Xmx by default. Causes Wings resource overhead allocation to be unnecessary.

Expands Forge installer exit code to provide instructions regarding increasing Wings installer resource limits when using unlimited memory (0) as the default 1024MB is not enough to run the installer.

The percentage is set as a floating point, because of a JDK 8 bug with integers
2022-06-26 21:16:26 -04:00
DaneEveritt 446562fcff Update NodeFactory.php 2022-06-26 21:00:19 -04:00
DaneEveritt 3f2bd78563 Generate a more unique username 2022-06-26 16:37:43 -04:00
DaneEveritt 0520014c0f Add support for tracking when an activity event is triggered from an API key 2022-06-18 12:07:44 -04:00
DaneEveritt e15985ea39 Add support for automatically pruning activity logs 2022-05-29 19:45:00 -04:00
DaneEveritt 0621d8475d Return tests to passing now that we don't ignore a critical event... 2022-05-29 17:52:14 -04:00
DaneEveritt f1c1699994 Fix tests with model events 2022-05-29 17:07:34 -04:00
DaneEveritt 2fc5a734f9 Update backup logic to use activity logs, not audit logs 2022-05-29 16:19:04 -04:00
DaneEveritt cbecfff6da Add activity logging for files 2022-05-29 13:56:39 -04:00
DaneEveritt 5bb66a00d8 Add new activity logging code to replace audit log 2022-05-28 15:36:26 -04:00
DaneEveritt b051718afe Fix up API handling logic for keys and set a prefix on all keys 2022-05-22 19:03:51 -04:00
DaneEveritt f7fc67344e Ensure tokens are found in the database using the expected logic 2022-05-22 16:05:58 -04:00
Alex d0b6ae00dc fix: update Paper API (#4080)
Paper api endpoints have been updated to api.papermc.io/v2 from the old papermc.io/api/v2
2022-05-21 15:50:07 -04:00
DaneEveritt 8483db755d Fix SSH key factory 2022-05-15 16:47:58 -04:00
DaneEveritt cca0010a00 Update egg import/update logic to all use the same pathwaus 2022-05-15 14:40:19 -04:00
DaneEveritt 6554164252 Add test coverage for the SSH key endpoints 2022-05-14 18:08:48 -04:00