More icons and a couple tweaks

This commit is contained in:
Lance Pioch 2024-04-12 12:18:41 -04:00
parent 65acb3fd94
commit 8575f1b036

View File

@ -62,6 +62,7 @@ class ServerResource extends Resource
->required(), ->required(),
Forms\Components\Select::make('node_id') Forms\Components\Select::make('node_id')
->disabledOn('edit')
->prefixIcon('tabler-server-2') ->prefixIcon('tabler-server-2')
->default(fn () => Node::query()->latest()->first()->id) ->default(fn () => Node::query()->latest()->first()->id)
->columnSpan(2) ->columnSpan(2)
@ -212,14 +213,17 @@ class ServerResource extends Resource
->columns(3) ->columns(3)
->schema([ ->schema([
Forms\Components\TextInput::make('allocation_limit') Forms\Components\TextInput::make('allocation_limit')
->suffixIcon('tabler-network')
->required() ->required()
->numeric() ->numeric()
->default(0), ->default(0),
Forms\Components\TextInput::make('database_limit') Forms\Components\TextInput::make('database_limit')
->suffixIcon('tabler-database')
->required() ->required()
->numeric() ->numeric()
->default(0), ->default(0),
Forms\Components\TextInput::make('backup_limit') Forms\Components\TextInput::make('backup_limit')
->suffixIcon('tabler-copy-check')
->required() ->required()
->numeric() ->numeric()
->default(0), ->default(0),
@ -290,6 +294,10 @@ class ServerResource extends Resource
false => 'success', false => 'success',
true => 'danger', true => 'danger',
]) ])
->icons([
false => 'tabler-sword-off',
true => 'tabler-sword',
])
->required(), ->required(),
]), ]),
@ -327,8 +335,6 @@ class ServerResource extends Resource
->schema([ ->schema([
Forms\Components\TextInput::make('variable_value') Forms\Components\TextInput::make('variable_value')
//->rule(0, fn (Forms\Get $get) => str($get('rules'))) // TODO
->rules([ ->rules([
fn (Forms\Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { fn (Forms\Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
$validator = Validator::make(['validatorkey' => $value], [ $validator = Validator::make(['validatorkey' => $value], [