refactor
This commit is contained in:
@@ -26,7 +26,7 @@ class DatabaseController extends Controller
|
||||
return view('project.database.configuration', ['database' => $database]);
|
||||
}
|
||||
|
||||
public function backup_logs()
|
||||
public function executions()
|
||||
{
|
||||
$backup_uuid = request()->route('backup_uuid');
|
||||
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||
@@ -45,8 +45,8 @@ class DatabaseController extends Controller
|
||||
if (!$backup) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
$backup_executions = collect($backup->executions)->sortByDesc('created_at');
|
||||
return view('project.database.backups.logs', ['database' => $database, 'backup' => $backup, 'backup_executions' => $backup_executions]);
|
||||
$executions = collect($backup->executions)->sortByDesc('created_at');
|
||||
return view('project.database.backups.executions', ['database' => $database, 'backup' => $backup, 'executions' => $executions]);
|
||||
}
|
||||
|
||||
public function backups()
|
||||
|
||||
@@ -12,6 +12,6 @@ class BackupExecutions extends Component
|
||||
|
||||
public function refreshBackupExecutions(): void
|
||||
{
|
||||
$this->executions = collect($this->backup->executions)->sortByDesc('created_at');
|
||||
$this->executions = $this->backup->executions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ class DatabaseBackupJob implements ShouldQueue
|
||||
$this->backup_status = 'failed';
|
||||
$this->add_to_backup_output($th->getMessage());
|
||||
ray('Backup failed for ' . $this->database->uuid . ' at ' . $this->server->name . ':' . $this->backup_filename . '\n\nError:' . $th->getMessage());
|
||||
$this->team->notify(new BackupFailed($this->backup, $this->database));
|
||||
$this->team->notify(new BackupFailed($this->backup, $this->database, $this->backup_output));
|
||||
} finally {
|
||||
$this->backup_log->update([
|
||||
'status' => $this->backup_status,
|
||||
|
||||
@@ -17,9 +17,9 @@ class BackupFailed extends Notification implements ShouldQueue
|
||||
public string $message = 'Backup FAILED';
|
||||
|
||||
|
||||
public function __construct(ScheduledDatabaseBackup $backup, public $database)
|
||||
public function __construct(ScheduledDatabaseBackup $backup, public $database, public $output)
|
||||
{
|
||||
$this->message = "❌ Database backup for {$database->name} with frequency of $backup->frequency was FAILED.";
|
||||
$this->message = "❌ Database backup for {$database->name} with frequency of $backup->frequency was FAILED.\n\nReason: $output";
|
||||
}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
|
||||
Reference in New Issue
Block a user