admin add more field searchable

This commit is contained in:
xiaomlove
2022-07-05 16:09:43 +08:00
parent 9d07bd58bf
commit 29fa81f7e0
4 changed files with 7 additions and 5 deletions
@@ -53,7 +53,7 @@ class TagResource extends Resource
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
Tables\Columns\TextColumn::make('name')->label(__('label.name')),
Tables\Columns\TextColumn::make('name')->label(__('label.name'))->searchable(),
Tables\Columns\TextColumn::make('color')->label(__('label.tag.color')),
Tables\Columns\TextColumn::make('font_color')->label(__('label.tag.font_color')),
Tables\Columns\TextColumn::make('font_size')->label(__('label.tag.font_size')),
@@ -69,7 +69,7 @@ class TorrentResource extends Resource
$tags = sprintf('&nbsp;<div>%s</div>', $record->tagsFormatted);
return new HtmlString('<div class="flex">' . $name . $tags . '</div>');
})->label(__('label.name')),
})->label(__('label.name'))->searchable(),
Tables\Columns\TextColumn::make('posStateText')->label(__('label.torrent.pos_state')),
Tables\Columns\TextColumn::make('spStateText')->label(__('label.torrent.sp_state')),
Tables\Columns\TextColumn::make('size')->label(__('label.torrent.size'))->formatStateUsing(fn ($state) => mksize($state)),
@@ -139,6 +139,7 @@ class TorrentResource extends Resource
Forms\Components\Select::make('pos_state')
->label(__('label.torrent.pos_state'))
->options(Torrent::listPosStates(true))
->required()
])
->icon('heroicon-o-arrow-circle-up')
->action(function (Collection $records, array $data) {
@@ -163,7 +164,8 @@ class TorrentResource extends Resource
Forms\Components\CheckboxList::make('tags')
->label(__('label.tag.label'))
->columns(4)
->options(TagRepository::createBasicQuery()->pluck('name', 'id')->toArray()),
->options(TagRepository::createBasicQuery()->pluck('name', 'id')->toArray())
->required(),
])
->icon('heroicon-o-tag')
->action(function (Collection $records, array $data) {