torrent keyword search remove or

This commit is contained in:
xiaomlove
2023-03-04 13:26:20 +08:00
parent 8d49bb3024
commit 37920145b0
13 changed files with 81 additions and 40 deletions

View File

@@ -80,8 +80,9 @@ class ViewHitAndRun extends ViewRecord
protected function getActions(): array
{
return [
Actions\Action::make('Pardon')
$actions = [];
if (in_array($this->record->status, HitAndRun::CAN_PARDON_STATUS)) {
$actions[] = Actions\Action::make('Pardon')
->requiresConfirmation()
->action(function () {
$hitAndRunRep = new HitAndRunRepository();
@@ -93,10 +94,12 @@ class ViewHitAndRun extends ViewRecord
$this->notify('danger', $exception->getMessage());
}
})
->label(__('admin.resources.hit_and_run.action_pardon')),
->label(__('admin.resources.hit_and_run.action_pardon'))
;
}
$actions[] = Actions\DeleteAction::make();
Actions\DeleteAction::make(),
];
return $actions;
}
}