refactor(backup): auto-delete file from server after download and simplify header buttons
This commit is contained in:
@@ -162,11 +162,16 @@ class BackupController extends Controller
|
|||||||
targetName: $filename
|
targetName: $filename
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Perbarui status di log riwayat dan hapus file sementara dari disk VPS setelah unduhan selesai
|
||||||
|
BackupLog::where('filename', $filename)->update([
|
||||||
|
'status' => 'Tersimpan di Komputer Lokal',
|
||||||
|
]);
|
||||||
|
|
||||||
return response()->download($fullPath, $filename, [
|
return response()->download($fullPath, $filename, [
|
||||||
'Cache-Control' => 'no-cache, no-store, must-revalidate',
|
'Cache-Control' => 'no-cache, no-store, must-revalidate',
|
||||||
'Pragma' => 'no-cache',
|
'Pragma' => 'no-cache',
|
||||||
'Expires' => '0',
|
'Expires' => '0',
|
||||||
]);
|
])->deleteFileAfterSend(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,11 +20,6 @@
|
|||||||
class="px-3.5 py-2 rounded-xl border border-amber-300 bg-amber-50 hover:bg-amber-100 text-amber-900 text-xs font-semibold transition shadow-2xs">
|
class="px-3.5 py-2 rounded-xl border border-amber-300 bg-amber-50 hover:bg-amber-100 text-amber-900 text-xs font-semibold transition shadow-2xs">
|
||||||
Pulihkan dari File .kmh
|
Pulihkan dari File .kmh
|
||||||
</button>
|
</button>
|
||||||
<button type="button"
|
|
||||||
onclick="openUploadBackupModal()"
|
|
||||||
class="px-3.5 py-2 rounded-xl border border-slate-200 bg-white hover:bg-slate-50 text-slate-700 text-xs font-semibold transition shadow-2xs">
|
|
||||||
Unggah ke Server
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
<button type="button"
|
||||||
onclick="openCreateBackupModal()"
|
onclick="openCreateBackupModal()"
|
||||||
class="px-4 py-2 rounded-xl bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-semibold transition shadow-xs">
|
class="px-4 py-2 rounded-xl bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-semibold transition shadow-xs">
|
||||||
|
|||||||
Reference in New Issue
Block a user