fix filament resource notify

This commit is contained in:
xiaomlove
2025-02-08 01:24:29 +08:00
parent 4a0475b49c
commit e45b7c42f0
9 changed files with 20 additions and 26 deletions

View File

@@ -24,10 +24,10 @@ class EditSeedBoxRecord extends EditRecord
$rep = new SeedBoxRepository();
try {
$this->record = $rep->update($data, $this->record->id);
$this->notify('success', $this->getSavedNotificationTitle());
send_admin_success_notification();
$this->redirect($this->getResource()::getUrl('index'));
} catch (\Exception $exception) {
$this->notify('danger', $exception->getMessage());
send_admin_fail_notification($exception->getMessage());
}
}
}

View File

@@ -26,12 +26,12 @@ class ListSeedBoxRecords extends PageList
->action(function ($data) {
try {
isIPSeedBox($data['ip'], $data['uid'], true, true);
$this->notify('success', nexus_trans("seed-box.is_seed_box_no"));
send_admin_success_notification(nexus_trans("seed-box.is_seed_box_no"));
} catch (SeedBoxYesException $exception) {
$this->notify('danger', nexus_trans("seed-box.is_seed_box_yes", ['id' => $exception->getId()]));
send_admin_fail_notification(nexus_trans("seed-box.is_seed_box_yes", ['id' => $exception->getId()]));
} catch (\Throwable $throwable) {
do_log($throwable->getMessage() . $throwable->getTraceAsString(), "error");
$this->notify('danger', $throwable->getMessage());
send_admin_fail_notification($throwable->getMessage());
}
})
];