mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-08 06:08:40 +02:00
add toggle to startup-variable view
This commit is contained in:
parent
9a8c7e651c
commit
b70b8e477d
@ -6,5 +6,5 @@ enum StartupVariableType: string
|
||||
{
|
||||
case Text = 'text';
|
||||
case Select = 'select';
|
||||
case Toggle = 'toggle'; // TODO: add toggle to blade view
|
||||
case Toggle = 'toggle';
|
||||
}
|
||||
|
@ -19,7 +19,8 @@
|
||||
:valid="! $errors->has($statePath)"
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($getExtraAttributeBag())->class([
|
||||
'fi-fo-text-input overflow-hidden' => $type === \App\Enums\StartupVariableType::Text,
|
||||
'fi-fo-select' => $type === \App\Enums\StartupVariableType::Select
|
||||
'fi-fo-select' => $type === \App\Enums\StartupVariableType::Select,
|
||||
'fi-fo-toggle p-1' => $type === \App\Enums\StartupVariableType::Toggle
|
||||
])"
|
||||
>
|
||||
@if ($type === \App\Enums\StartupVariableType::Select)
|
||||
@ -48,6 +49,19 @@
|
||||
</option>
|
||||
@endforeach
|
||||
</x-filament::input.select>
|
||||
@elseif($type === \App\Enums\StartupVariableType::Toggle)
|
||||
<x-filament::toggle
|
||||
:id="$getId()"
|
||||
:required="$isRequired"
|
||||
:disabled="$isDisabled"
|
||||
:attributes="
|
||||
$getExtraInputAttributeBag()
|
||||
->class(['ml-2'])
|
||||
->merge([
|
||||
'state' => '$wire.' . $applyStateBindingModifiers('$entangle(\'' . $statePath . '\')'),
|
||||
], escape: false)
|
||||
"
|
||||
/>
|
||||
@else
|
||||
<x-filament::input
|
||||
:id="$getId()"
|
||||
|
Loading…
x
Reference in New Issue
Block a user