diff --git a/app/Filament/Resources/Torrent/TagResource.php b/app/Filament/Resources/Torrent/TagResource.php index cdd9728e..cd30070e 100644 --- a/app/Filament/Resources/Torrent/TagResource.php +++ b/app/Filament/Resources/Torrent/TagResource.php @@ -72,7 +72,8 @@ class TagResource extends Resource Tables\Columns\TextColumn::make('border_radius')->label(__('label.tag.border_radius')), Tables\Columns\TextColumn::make('priority')->label(__('label.priority'))->sortable(), Tables\Columns\TextColumn::make('torrents_count')->label(__('label.tag.torrents_count')), - Tables\Columns\TextColumn::make('updated_at')->dateTime()->label(__('label.updated_at')), + Tables\Columns\TextColumn::make('torrents_sum_size')->label(__('label.tag.torrents_sum_size'))->formatStateUsing(fn ($state) => mksize($state)), +// Tables\Columns\TextColumn::make('updated_at')->dateTime()->label(__('label.updated_at')), ]) ->defaultSort('priority', 'desc') ->filters([ diff --git a/app/Filament/Resources/Torrent/TagResource/Pages/ListTags.php b/app/Filament/Resources/Torrent/TagResource/Pages/ListTags.php index 5030e7ce..4e143399 100644 --- a/app/Filament/Resources/Torrent/TagResource/Pages/ListTags.php +++ b/app/Filament/Resources/Torrent/TagResource/Pages/ListTags.php @@ -23,7 +23,7 @@ class ListTags extends PageList protected function getTableQuery(): Builder { - return Tag::query()->withCount('torrents'); + return Tag::query()->withCount('torrents')->withSum('torrents', 'size'); } } diff --git a/app/Filament/Resources/Torrent/TorrentResource.php b/app/Filament/Resources/Torrent/TorrentResource.php index c5545345..6d8e913e 100644 --- a/app/Filament/Resources/Torrent/TorrentResource.php +++ b/app/Filament/Resources/Torrent/TorrentResource.php @@ -151,6 +151,11 @@ class TorrentResource extends Resource Tables\Filters\SelectFilter::make('hr') ->options(self::getYesNoOptions()) ->label(__('label.torrent.hr')), + + Tables\Filters\SelectFilter::make('tags') + ->relationship('tags', 'name') + ->label(__('label.tag.label')) + , ]) ->actions(self::getActions()) ->bulkActions(self::getBulkActions()); diff --git a/app/Filament/Resources/User/UserResource.php b/app/Filament/Resources/User/UserResource.php index a0a6417a..a6138782 100644 --- a/app/Filament/Resources/User/UserResource.php +++ b/app/Filament/Resources/User/UserResource.php @@ -75,6 +75,7 @@ class UserResource extends Resource Tables\Columns\BadgeColumn::make('status')->colors(['success' => 'confirmed', 'warning' => 'pending'])->label(__("label.user.status")), Tables\Columns\BadgeColumn::make('enabled')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.enabled")), Tables\Columns\BadgeColumn::make('downloadpos')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.downloadpos")), + Tables\Columns\BadgeColumn::make('parked')->colors(['success' => 'yes', 'danger' => 'no'])->label(__("label.user.parked")), Tables\Columns\TextColumn::make('added')->sortable()->dateTime('Y-m-d H:i')->label(__("label.added")), Tables\Columns\TextColumn::make('last_access')->dateTime()->label(__("label.last_access")), ]) @@ -93,6 +94,7 @@ class UserResource extends Resource Tables\Filters\SelectFilter::make('status')->options(['confirmed' => 'confirmed', 'pending' => 'pending'])->label(__('label.user.status')), Tables\Filters\SelectFilter::make('enabled')->options(self::$yesOrNo)->label(__('label.user.enabled')), Tables\Filters\SelectFilter::make('downloadpos')->options(self::$yesOrNo)->label(__('label.user.downloadpos')), + Tables\Filters\SelectFilter::make('parked')->options(self::$yesOrNo)->label(__('label.user.parked')), ]) ->actions([ Tables\Actions\ViewAction::make(), diff --git a/app/Models/Taxonomy.php b/app/Models/Taxonomy.php deleted file mode 100644 index 8e895004..00000000 --- a/app/Models/Taxonomy.php +++ /dev/null @@ -1,11 +0,0 @@ -id(); - $table->integer('mode')->default(0); - $table->string('name'); - $table->string('torrent_field'); - $table->string('image')->nullable(true); - $table->string('class_name')->nullable(true); - $table->integer('priority')->default(0); - - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('taxonomies'); - } -}; diff --git a/include/constants.php b/include/constants.php index a73cc96e..7fab68f4 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ with(['categories', 'categories.icon'])->findOrFail($mode); $lang = get_langfolder_cookie(); $withTaxonomies = []; @@ -6115,6 +6127,11 @@ TD; $checked = ''; if (str_contains($checkedValues, "[{$namePrefix}{$item->id}]") || str_contains($checkedValues, "{$namePrefix}{$item->id}=1")) { $checked = ' checked'; + } elseif (!empty($options['user_notifs'])) { + $userNotifsKey = sprintf('[%s%s]', substr($torrentField, 0, 3), $item->id); + if (str_contains($options['user_notifs'], $userNotifsKey)) { + $checked = ' checked'; + } } $tdContent = <<$afterInput diff --git a/public/torrents.php b/public/torrents.php index e48040b6..bfceda8f 100644 --- a/public/torrents.php +++ b/public/torrents.php @@ -983,7 +983,7 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin // } // ?> - true])?> + true, 'user_notifs' => $CURUSER['notifs']])?> diff --git a/resources/lang/en/label.php b/resources/lang/en/label.php index 2fc1adef..c299cb31 100644 --- a/resources/lang/en/label.php +++ b/resources/lang/en/label.php @@ -100,6 +100,8 @@ return [ 'two_step_authentication' => 'Two-step authentication', 'seed_points' => 'Seed points', 'downloadpos' => 'Download privileges', + 'parked' => 'Parked', + 'offer_allowed_count' => 'Offer allowed count', ], 'medal' => [ 'label' => 'Medal', @@ -174,6 +176,7 @@ return [ 'padding' => 'Padding', 'border_radius' => 'Border radius', 'torrents_count' => 'Torrents count', + 'torrents_sum_size' => 'Torrents size', ], 'agent_allow' => [ 'label' => 'Agent allow', diff --git a/resources/lang/zh_CN/label.php b/resources/lang/zh_CN/label.php index 956e893c..91c44f06 100644 --- a/resources/lang/zh_CN/label.php +++ b/resources/lang/zh_CN/label.php @@ -100,6 +100,8 @@ return [ 'two_step_authentication' => '两步验证', 'seed_points' => '做种积分', 'downloadpos' => '下载权限', + 'parked' => '挂起', + 'offer_allowed_count' => '候选通过数', ], 'medal' => [ 'label' => '勋章', @@ -174,6 +176,7 @@ return [ 'padding' => '内边距', 'border_radius' => '边框圆角', 'torrents_count' => '种子数', + 'torrents_sum_size' => '种子体积', ], 'agent_allow' => [ 'label' => '允许客户端', diff --git a/resources/lang/zh_TW/label.php b/resources/lang/zh_TW/label.php index 1d9cc33d..965727b8 100644 --- a/resources/lang/zh_TW/label.php +++ b/resources/lang/zh_TW/label.php @@ -100,6 +100,8 @@ return [ 'two_step_authentication' => '兩步驗證', 'seed_points' => '做種積分', 'downloadpos' => '下載權限', + 'parked' => '掛起', + 'offer_allowed_count' => '候選通過數', ], 'medal' => [ 'label' => '勛章', @@ -174,6 +176,7 @@ return [ 'padding' => '內邊距', 'border_radius' => '邊框圓角', 'torrents_count' => '種子數', + 'torrents_sum_size' => '種子體積', ], 'agent_allow' => [ 'label' => '允許客戶端', diff --git a/resources/views/filament/resources/user/user-resource/pages/user-profile.blade.php b/resources/views/filament/resources/user/user-resource/pages/user-profile.blade.php index 38f4c15f..faf61d4a 100644 --- a/resources/views/filament/resources/user/user-resource/pages/user-profile.blade.php +++ b/resources/views/filament/resources/user/user-resource/pages/user-profile.blade.php @@ -65,6 +65,16 @@ {{$record->downloadpos}} + + {{__('label.user.parked')}} + {{$record->parked}} + + + + {{__('label.user.offer_allowed_count')}} + {{$record->offer_allowed_count}} + + {{__('label.user.seed_points')}} {{$record->seed_points}}