mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 11:27:24 +08:00
improve searchbox extra
This commit is contained in:
@@ -44,7 +44,7 @@ class SecondIconResource extends Resource
|
||||
$specialMode = Setting::get('main.specialcat');
|
||||
$torrentTaxonomySchema = $searchBoxRep->listTaxonomyFormSchema($torrentMode);
|
||||
$specialTaxonomySchema = $searchBoxRep->listTaxonomyFormSchema($specialMode);
|
||||
$modeOptions = SearchBox::query()->whereIn('id', [$torrentMode, $specialMode])->pluck('name', 'id')->toArray();
|
||||
$modeOptions = SearchBox::listModeOptions();
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')
|
||||
@@ -52,12 +52,6 @@ class SecondIconResource extends Resource
|
||||
->required()
|
||||
->helperText(__('label.second_icon.name_help'))
|
||||
,
|
||||
Forms\Components\Select::make('mode')
|
||||
->label(__('label.search_box.label'))
|
||||
->options($modeOptions)
|
||||
->required()
|
||||
->reactive()
|
||||
,
|
||||
Forms\Components\TextInput::make('image')
|
||||
->label(__('label.second_icon.image'))
|
||||
->required()
|
||||
@@ -79,6 +73,11 @@ class SecondIconResource extends Resource
|
||||
->columns(4)
|
||||
->hidden(fn (\Closure $get) => $get('mode') != $specialMode)
|
||||
,
|
||||
Forms\Components\Select::make('mode')
|
||||
->options($modeOptions)
|
||||
->label(__('label.search_box.taxonomy.mode'))
|
||||
->helperText(__('label.search_box.taxonomy.mode_help'))
|
||||
,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -109,6 +108,7 @@ class SecondIconResource extends Resource
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
|
||||
Reference in New Issue
Block a user