improve searchbox extra

This commit is contained in:
xiaomlove
2022-11-05 01:08:04 +08:00
parent 7b65d84752
commit 8dd2880e76
16 changed files with 96 additions and 71 deletions
@@ -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(),