Able to add scheduled backups through the UI
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
Stop
|
||||
</button>
|
||||
@else
|
||||
<button wire:click='start' onclick="logs.showModal()"
|
||||
<button wire:click='start' onclick="startDatabase.showModal()"
|
||||
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-warning" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
@php use App\Actions\CoolifyTask\RunRemoteProcess; @endphp
|
||||
<div>
|
||||
@if ($this->activity)
|
||||
@if ($header)
|
||||
@if (isset($header))
|
||||
<div class="flex gap-2 pb-2">
|
||||
<h3>Logs</h3>
|
||||
<h2>{{$header}}</h2>
|
||||
@if ($isPollingActive)
|
||||
<x-loading/>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<div
|
||||
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 text-xs text-white">
|
||||
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 text-xs text-white">
|
||||
|
||||
<pre class="font-mono whitespace-pre-wrap"
|
||||
@if ($isPollingActive) wire:poll.2000ms="polling" @endif>{{ RunRemoteProcess::decodeOutput($this->activity) }}</pre>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<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
|
||||
</x-forms.button>
|
||||
</form>
|
||||
<form method="dialog" class="modal-backdrop">
|
||||
<button>close</button>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@forelse($database->scheduledBackups as $backup)
|
||||
<div class="box flex flex-col">
|
||||
<div>Frequency: {{$backup->frequency}}</div>
|
||||
<div>Keep locally: {{$backup->keep_locally}}</div>
|
||||
<div>Sync to S3: {{$backup->save_s3}}</div>
|
||||
</div>
|
||||
@empty
|
||||
<div>No scheduled backups configured.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -14,6 +14,6 @@
|
||||
</x-forms.button>
|
||||
</form>
|
||||
<div class="container w-full pt-10 mx-auto">
|
||||
<livewire:activity-monitor :header="true"/>
|
||||
<livewire:activity-monitor header="Logs"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="container w-full py-4 mx-auto">
|
||||
<livewire:activity-monitor :header="true"/>
|
||||
<livewire:activity-monitor header="Logs"/>
|
||||
</div>
|
||||
@isset($uptime)
|
||||
<h3 class="pb-3">Server Info</h3>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
@endif
|
||||
<div class="container w-full pb-4 mx-auto">
|
||||
<livewire:activity-monitor :header="true"/>
|
||||
<livewire:activity-monitor header="Logs"/>
|
||||
</div>
|
||||
<x-forms.input placeholder="https://coolify.io" id="redirect_url" label="Default Redirect 404"
|
||||
helper="All urls that has no service available will be redirected to this domain.<span class='text-helper'>You can set to your main marketing page or your social media link.</span>"/>
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
<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>
|
||||
|
||||
<livewire:project.database.create-scheduled-backup :database="$database"/>
|
||||
<div class="pt-6">
|
||||
<h2 class="pb-4">Scheduled Backups</h2>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@forelse($database->scheduledBackups as $backup)
|
||||
<div class="box flex flex-col">
|
||||
<div>Frequency: {{$backup->frequency}}</div>
|
||||
<div>Keep locally: {{$backup->keep_locally}}</div>
|
||||
<div>Sync to S3: {{$backup->save_s3}}</div>
|
||||
</div>
|
||||
@empty
|
||||
<div>No scheduled backups configured.</div>
|
||||
@endforelse
|
||||
<div class="flex gap-2 ">
|
||||
<h2 class="pb-4">Scheduled Backups</h2>
|
||||
<x-forms.button onclick="createScheduledBackup.showModal()">+ Add</x-forms.button>
|
||||
</div>
|
||||
<livewire:project.database.scheduled-backups :database="$database"/>
|
||||
</div>
|
||||
</x-layout>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<x-layout>
|
||||
<h1>Configuration</h1>
|
||||
<livewire:project.database.heading :database="$database"/>
|
||||
<x-modal modalId="logs">
|
||||
<x-modal modalId="startDatabase">
|
||||
<x-slot:modalBody>
|
||||
<livewire:activity-monitor :header="true"/>
|
||||
<livewire:activity-monitor header="Startup Logs"/>
|
||||
</x-slot:modalBody>
|
||||
<x-slot:modalSubmit>
|
||||
<x-forms.button onclick="logs.close()" type="submit">
|
||||
<x-forms.button onclick="startDatabase.close()" type="submit">
|
||||
Close
|
||||
</x-forms.button>
|
||||
</x-slot:modalSubmit>
|
||||
|
||||
Reference in New Issue
Block a user