2024-06-05 09:44:10 +00:00
< div wire : init = 'refreshBackupExecutions' >
2024-05-24 07:35:36 +00:00
@ isset ( $backup )
< div class = " flex items-center gap-2 " >
2025-07-13 10:36:53 +00:00
< h3 class = " py-4 " > Executions < span class = " text-xs " > ({{ $executions_count }}) </ span ></ h3 >
@ if ( $executions_count > 0 )
< div class = " flex items-center gap-2 " >
< x - forms . button disabled = " { { ! $showPrev }} " wire : click = " previousPage(' { { $defaultTake }}') " >
< svg class = " w-4 h-4 " viewBox = " 0 0 24 24 " >
< path fill = " none " stroke = " currentColor " stroke - linecap = " round " stroke - linejoin = " round "
stroke - width = " 2 " d = " m14 6l-6 6l6 6z " />
</ svg >
</ x - forms . button >
< span class = " text-sm text-gray-600 dark:text-gray-400 px-2 " >
Page {{ $currentPage }} of {{ ceil ( $executions_count / $defaultTake ) }}
</ span >
< x - forms . button disabled = " { { ! $showNext }} " wire : click = " nextPage(' { { $defaultTake }}') " >
< svg class = " w-4 h-4 " viewBox = " 0 0 24 24 " >
< path fill = " none " stroke = " currentColor " stroke - linecap = " round " stroke - linejoin = " round "
stroke - width = " 2 " d = " m10 18l6-6l-6-6z " />
</ svg >
</ x - forms . button >
</ div >
@ endif
2024-05-24 07:35:36 +00:00
< x - forms . button wire : click = 'cleanupFailed' > Cleanup Failed Backups </ x - forms . button >
2025-07-13 10:36:53 +00:00
< x - modal - confirmation title = " Cleanup Deleted Backup Entries? " buttonTitle = " Cleanup Deleted " isErrorButton
submitAction = " cleanupDeleted() "
: actions = " ['This will permanently delete all backup execution entries that are marked as deleted from local storage.', 'This only removes database entries, not actual backup files.'] "
confirmationText = " cleanup deleted backups "
confirmationLabel = " Please confirm by typing 'cleanup deleted backups' below "
shortConfirmationLabel = " Confirmation " />
2024-05-24 07:35:36 +00:00
</ div >
2025-07-13 10:36:53 +00:00
< div @ if ( ! $skip ) wire : poll . 5000 ms = " refreshBackupExecutions " @ endif
class = " flex flex-col gap-4 " >
2024-05-24 07:35:36 +00:00
@ forelse ( $executions as $execution )
2024-08-26 13:26:08 +00:00
< div wire : key = " { { data_get( $execution , 'id') }} " @ class ([
2025-01-15 17:35:20 +00:00
'flex flex-col border-l-2 transition-colors p-4 bg-white dark:bg-coolgray-100 text-black dark:text-white' ,
2025-06-30 07:15:23 +00:00
'border-blue-500/50 border-dashed' =>
data_get ( $execution , 'status' ) === 'running' ,
2025-01-15 17:35:20 +00:00
'border-error' => data_get ( $execution , 'status' ) === 'failed' ,
'border-success' => data_get ( $execution , 'status' ) === 'success' ,
2024-08-26 13:26:08 +00:00
]) >
2024-05-24 07:35:36 +00:00
@ if ( data_get ( $execution , 'status' ) === 'running' )
< div class = " absolute top-2 right-2 " >
< x - loading />
</ div >
@ endif
2025-01-15 17:35:20 +00:00
< div class = " flex items-center gap-2 mb-2 " >
< span @ class ([
2025-05-14 10:43:23 +00:00
'px-3 py-1 rounded-md text-xs font-medium tracking-wide shadow-xs' ,
2025-06-30 07:15:23 +00:00
'bg-blue-100/80 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300 dark:shadow-blue-900/5' =>
data_get ( $execution , 'status' ) === 'running' ,
'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200 dark:shadow-red-900/5' =>
data_get ( $execution , 'status' ) === 'failed' ,
2025-10-07 13:02:23 +00:00
'bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-200 dark:shadow-amber-900/5' =>
data_get ( $execution , 'status' ) === 'success' && data_get ( $execution , 's3_uploaded' ) === false ,
2025-06-30 07:15:23 +00:00
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 dark:shadow-green-900/5' =>
2025-10-07 13:02:23 +00:00
data_get ( $execution , 'status' ) === 'success' && data_get ( $execution , 's3_uploaded' ) !== false ,
2025-01-15 17:35:20 +00:00
]) >
@ php
2025-06-30 07:15:23 +00:00
$statusText = match ( data_get ( $execution , 'status' )) {
2025-10-07 13:02:23 +00:00
'success' => data_get ( $execution , 's3_uploaded' ) === false ? 'Success (S3 Warning)' : 'Success' ,
2025-01-15 17:35:20 +00:00
'running' => 'In Progress' ,
'failed' => 'Failed' ,
2025-06-30 07:15:23 +00:00
default => ucfirst ( data_get ( $execution , 'status' )),
2025-01-15 17:35:20 +00:00
};
@ endphp
{{ $statusText }}
</ span >
</ div >
2024-08-26 13:26:08 +00:00
< div class = " text-gray-600 dark:text-gray-400 text-sm " >
2025-01-15 17:35:20 +00:00
Started : {{ formatDateInServerTimezone ( data_get ( $execution , 'created_at' ), $this -> server ()) }}
2025-06-30 07:15:23 +00:00
@ if ( data_get ( $execution , 'status' ) !== 'running' )
< br > Ended :
{{ formatDateInServerTimezone ( data_get ( $execution , 'finished_at' ), $this -> server ()) }}
< br > Duration :
{{ calculateDuration ( data_get ( $execution , 'created_at' ), data_get ( $execution , 'finished_at' )) }}
2025-01-23 12:21:11 +00:00
< br > Finished {{ \Carbon\Carbon :: parse ( data_get ( $execution , 'finished_at' )) -> diffForHumans () }}
2025-01-15 17:35:20 +00:00
@ endif
2024-08-26 13:26:08 +00:00
</ div >
< div class = " text-gray-600 dark:text-gray-400 text-sm " >
Database : {{ data_get ( $execution , 'database_name' , 'N/A' ) }}
</ div >
< div class = " text-gray-600 dark:text-gray-400 text-sm " >
Size : {{ data_get ( $execution , 'size' ) }} B /
{{ round (( int ) data_get ( $execution , 'size' ) / 1024 , 2 ) }} kB /
{{ round (( int ) data_get ( $execution , 'size' ) / 1024 / 1024 , 3 ) }} MB
</ div >
< div class = " text-gray-600 dark:text-gray-400 text-sm " >
Location : {{ data_get ( $execution , 'filename' , 'N/A' ) }}
</ div >
2025-03-14 14:28:12 +00:00
< div class = " flex items-center gap-3 mt-2 " >
< div class = " text-gray-600 dark:text-gray-400 text-sm " >
Backup Availability :
</ div >
< span @ class ([
2025-05-14 10:43:23 +00:00
'px-2 py-1 rounded-sm text-xs font-medium' ,
2025-06-30 07:15:23 +00:00
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200' => ! data_get (
$execution ,
'local_storage_deleted' ,
false ),
'bg-gray-100 text-gray-600 dark:bg-gray-800/50 dark:text-gray-400' => data_get (
$execution ,
'local_storage_deleted' ,
false ),
2025-03-14 14:28:12 +00:00
]) >
< span class = " flex items-center gap-1 " >
2025-06-30 07:15:23 +00:00
@ if ( ! data_get ( $execution , 'local_storage_deleted' , false ))
< svg class = " w-3 h-3 " fill = " currentColor " viewBox = " 0 0 20 20 "
xmlns = " http://www.w3.org/2000/svg " >
< path fill - rule = " evenodd "
d = " M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z "
clip - rule = " evenodd " ></ path >
2025-03-14 14:28:12 +00:00
</ svg >
@ else
2025-06-30 07:15:23 +00:00
< svg class = " w-3 h-3 " fill = " currentColor " viewBox = " 0 0 20 20 "
xmlns = " http://www.w3.org/2000/svg " >
< path fill - rule = " evenodd "
d = " M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z "
clip - rule = " evenodd " ></ path >
2025-03-14 14:28:12 +00:00
</ svg >
@ endif
Local Storage
</ span >
</ span >
2025-10-07 13:02:23 +00:00
@ if ( data_get ( $execution , 's3_uploaded' ) !== null )
2025-03-14 14:28:12 +00:00
< span @ class ([
2025-05-14 10:43:23 +00:00
'px-2 py-1 rounded-sm text-xs font-medium' ,
2025-10-07 13:02:23 +00:00
'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200' => data_get ( $execution , 's3_uploaded' ) === false && ! data_get ( $execution , 's3_storage_deleted' , false ),
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200' => data_get ( $execution , 's3_uploaded' ) === true && ! data_get ( $execution , 's3_storage_deleted' , false ),
'bg-gray-100 text-gray-600 dark:bg-gray-800/50 dark:text-gray-400' => data_get ( $execution , 's3_storage_deleted' , false ),
2025-03-14 14:28:12 +00:00
]) >
< span class = " flex items-center gap-1 " >
2025-10-07 13:02:23 +00:00
@ if ( data_get ( $execution , 's3_uploaded' ) === true && ! data_get ( $execution , 's3_storage_deleted' , false ))
2025-06-30 07:15:23 +00:00
< svg class = " w-3 h-3 " fill = " currentColor " viewBox = " 0 0 20 20 "
xmlns = " http://www.w3.org/2000/svg " >
< path fill - rule = " evenodd "
d = " M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z "
clip - rule = " evenodd " ></ path >
2025-03-14 14:28:12 +00:00
</ svg >
@ else
2025-06-30 07:15:23 +00:00
< svg class = " w-3 h-3 " fill = " currentColor " viewBox = " 0 0 20 20 "
xmlns = " http://www.w3.org/2000/svg " >
< path fill - rule = " evenodd "
d = " M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z "
clip - rule = " evenodd " ></ path >
2025-03-14 14:28:12 +00:00
</ svg >
@ endif
S3 Storage
</ span >
</ span >
@ endif
</ div >
2024-05-24 07:35:36 +00:00
@ if ( data_get ( $execution , 'message' ))
2025-05-14 10:43:23 +00:00
< div class = " mt-2 p-2 bg-gray-100 dark:bg-coolgray-200 rounded-sm " >
2024-08-26 13:26:08 +00:00
< pre class = " whitespace-pre-wrap text-sm " > {{ data_get ( $execution , 'message' ) }} </ pre >
</ div >
2024-04-29 07:38:45 +00:00
@ endif
2024-08-26 13:26:08 +00:00
< div class = " flex gap-2 mt-4 " >
2024-05-24 07:35:36 +00:00
@ if ( data_get ( $execution , 'status' ) === 'success' )
2024-08-26 13:26:08 +00:00
< x - forms . button class = " dark:hover:bg-coolgray-400 "
2024-05-24 07:35:36 +00:00
x - on : click = " download_file(' { { data_get( $execution , 'id') }}') " > Download </ x - forms . button >
@ endif
2025-10-07 13:02:23 +00:00
@ php
$executionCheckboxes = [];
$deleteActions = [];
if ( ! data_get ( $execution , 'local_storage_deleted' , false )) {
$deleteActions [] = 'This backup will be permanently deleted from local storage.' ;
}
if ( data_get ( $execution , 's3_uploaded' ) === true && ! data_get ( $execution , 's3_storage_deleted' , false )) {
$executionCheckboxes [] = [ 'id' => 'delete_backup_s3' , 'label' => 'Delete the selected backup permanently from S3 Storage' ];
}
if ( empty ( $deleteActions )) {
$deleteActions [] = 'This backup execution record will be deleted.' ;
}
@ endphp
2024-10-02 09:45:30 +00:00
< x - modal - confirmation title = " Confirm Backup Deletion? " buttonTitle = " Delete " isErrorButton
2025-10-07 13:02:23 +00:00
submitAction = " deleteBackup( { { data_get( $execution , 'id') }}) " : checkboxes = " $executionCheckboxes "
: actions = " $deleteActions " confirmationText = " { { data_get( $execution , 'filename') }} "
2024-10-02 09:45:30 +00:00
confirmationLabel = " Please confirm the execution of the actions by entering the Backup Filename below "
2025-06-30 07:15:23 +00:00
shortConfirmationLabel = " Backup Filename " 1 />
2024-05-24 07:35:36 +00:00
</ div >
2024-08-26 13:26:08 +00:00
</ div >
2024-05-24 07:35:36 +00:00
@ empty
2025-05-14 10:43:23 +00:00
< div class = " p-4 bg-gray-100 dark:bg-coolgray-100 rounded-sm " > No executions found .</ div >
2024-05-24 07:35:36 +00:00
@ endforelse
</ div >
< script >
function download_file ( executionId ) {
window . open ( '/download/backup/' + executionId , '_blank' );
}
</ script >
@ endisset
2023-08-10 13:52:54 +00:00
</ div >