Refactor + package updates + improve local backups
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
href="{{ route('project.database.configuration', $parameters) }}">
|
||||
<button>Configuration</button>
|
||||
</a>
|
||||
<a class="{{ request()->routeIs('project.database.backups') ? 'text-white' : '' }}"
|
||||
href="{{ route('project.database.backups', $parameters) }}">
|
||||
<a class="{{ request()->routeIs('project.database.backups.all') ? 'text-white' : '' }}"
|
||||
href="{{ route('project.database.backups.all', $parameters) }}">
|
||||
<button>Backups</button>
|
||||
</a>
|
||||
{{-- <x-applications.links :application="$application" /> --}}
|
||||
|
@@ -0,0 +1,16 @@
|
||||
<form wire:submit.prevent="submit">
|
||||
<div class="flex gap-2 pb-2">
|
||||
<h2>Scheduled Backup</h2>
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
</div>
|
||||
<div class="flex py-2 gap-10">
|
||||
<x-forms.checkbox instantSave label="Enabled" id="backup.enabled"/>
|
||||
<x-forms.checkbox instantSave label="Save to S3" id="backup.save_s3"/>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<x-forms.input label="Frequency" id="backup.frequency"/>
|
||||
<x-forms.input label="Number of backups to keep (locally)" id="backup.number_of_backups_locally"/>
|
||||
</div>
|
||||
</form>
|
@@ -0,0 +1,7 @@
|
||||
<div class="flex gap-2">
|
||||
<div class="flex-1"></div>
|
||||
{{-- @if(data_get($execution,'status') !== 'failed')--}}
|
||||
{{-- <x-forms.button class="bg-coollabs-100 hover:bg-coollabs" wire:click="download">Download</x-forms.button>--}}
|
||||
{{-- @endif--}}
|
||||
<x-forms.button isError wire:click="delete">Delete</x-forms.button>
|
||||
</div>
|
@@ -0,0 +1,22 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
@forelse($executions as $execution)
|
||||
<form class="border-1 bg-coolgray-300 p-2 border-dotted flex flex-col"
|
||||
@class([
|
||||
'border-green-500' => data_get($execution,'status') === 'success',
|
||||
'border-red-500' => data_get($execution,'status') === 'failed',
|
||||
])>
|
||||
<div>Status: {{data_get($execution,'status')}}</div>
|
||||
@if(data_get($execution,'message'))
|
||||
<div>Message: {{data_get($execution,'message')}}</div>
|
||||
@endif
|
||||
<div>Size: {{data_get($execution,'size')}} B / {{round((int)data_get($execution,'size') / 1024,2)}}
|
||||
kB / {{round((int)data_get($execution,'size')/1024/1024,2)}} MB
|
||||
</div>
|
||||
<div>Location: {{data_get($execution,'filename')}}</div>
|
||||
<livewire:project.database.backup-execution :execution="$execution" :wire:key="$execution->id"/>
|
||||
</form>
|
||||
@empty
|
||||
<div>No logs found.</div>
|
||||
@endforelse
|
||||
|
||||
</div>
|
@@ -1,7 +1,6 @@
|
||||
<dialog id="createScheduledBackup" class="modal">
|
||||
<form method="dialog" class="flex flex-col gap-2 rounded modal-box" wire:submit.prevent='submit'>
|
||||
<x-forms.input placeholder="1 * * * *" id="frequency" label="Frequency" required/>
|
||||
<x-forms.checkbox id="keep_locally" label="Keep Backups Locally"/>
|
||||
<x-forms.checkbox id="save_s3" label="Save to preconfigured S3"/>
|
||||
<x-forms.button onclick="createScheduledBackup.close()" type="submit">
|
||||
Save
|
||||
|
@@ -1,10 +1,11 @@
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@forelse($database->scheduledBackups as $backup)
|
||||
<div class="box flex flex-col">
|
||||
<a class="box flex flex-col"
|
||||
href="{{ route('project.database.backups.logs', [...$parameters,'backup_uuid'=> $backup->uuid]) }}">
|
||||
<div>Frequency: {{$backup->frequency}}</div>
|
||||
<div>Keep locally: {{$backup->keep_locally}}</div>
|
||||
<div>Sync to S3: {{$backup->save_s3}}</div>
|
||||
</div>
|
||||
<div>Last backup: {{data_get($backup->latest_log, 'status','No backup yet')}}</div>
|
||||
<div>Number of backups to keep (locally): {{$backup->number_of_backups_locally}}</div>
|
||||
</a>
|
||||
@empty
|
||||
<div>No scheduled backups configured.</div>
|
||||
@endforelse
|
||||
|
19
resources/views/project/database/backups/logs.blade.php
Normal file
19
resources/views/project/database/backups/logs.blade.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<x-layout>
|
||||
<h1>Backups</h1>
|
||||
<livewire:project.database.heading :database="$database"/>
|
||||
<x-modal modalId="startDatabase">
|
||||
<x-slot:modalBody>
|
||||
<livewire:activity-monitor header="Startup Logs"/>
|
||||
</x-slot:modalBody>
|
||||
<x-slot:modalSubmit>
|
||||
<x-forms.button onclick="startDatabase.close()" type="submit">
|
||||
Close
|
||||
</x-forms.button>
|
||||
</x-slot:modalSubmit>
|
||||
</x-modal>
|
||||
<div class="pt-6">
|
||||
<livewire:project.database.backup-edit :backup="$backup"/>
|
||||
<h3 class="py-4">Executions</h3>
|
||||
<livewire:project.database.backup-executions :backup="$backup" :executions="$backup_executions"/>
|
||||
</div>
|
||||
</x-layout>
|
Reference in New Issue
Block a user