mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 14:24:46 +02:00
Add server name generator
This commit is contained in:
parent
cbc255ddf8
commit
180bfc30a8
@ -38,6 +38,15 @@ class ServerResource extends Resource
|
|||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
->prefixIcon('tabler-server')
|
->prefixIcon('tabler-server')
|
||||||
->label('Display Name')
|
->label('Display Name')
|
||||||
|
->suffixAction(Forms\Components\Actions\Action::make('random')
|
||||||
|
->icon('tabler-dice-' . random_int(1, 6))
|
||||||
|
->color('primary')
|
||||||
|
->action(function (Forms\Set $set, Forms\Get $get) {
|
||||||
|
$egg = Egg::find($get('egg_id'));
|
||||||
|
$prefix = $egg ? str($egg->name)->lower()->snake() . '-' : '';
|
||||||
|
|
||||||
|
$set('name', $prefix . fake()->domainWord);
|
||||||
|
}))
|
||||||
->columnSpan(4)
|
->columnSpan(4)
|
||||||
->required()
|
->required()
|
||||||
->maxLength(191),
|
->maxLength(191),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user