Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fixes here and there

ayntk-aidfd218ec0647
diff --git a/app/Livewire/Destination/Form.php b/app/Livewire/Destination/Form.php
index f58538dc10..5b3115dea0 100644
--- a/app/Livewire/Destination/Form.php
+++ b/app/Livewire/Destination/Form.php
@@ -1,8 +1,6 @@
<?php
namespace App\Livewire\Destination;
-use Illuminate\Support\Facades\Auth;
-use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class Form extends Component
@@ -27,13 +25,8 @@ class Form extends Component
$this->destination->save();
}
- public function delete($password)
+ public function delete()
{
- if (!Hash::check($password, Auth::user()->password)) {
- $this->addError('password', 'The provided password is incorrect.');
- return;
- }
-
try {
if ($this->destination->getMorphClass() === 'App\Models\StandaloneDocker') {
if ($this->destination->attachedTo()) {
@@ -44,7 +37,7 @@ class Form extends Component
}
$this->destination->delete();
- return redirect()->route('dashboard');
+ return redirect()->route('destination.all');
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/app/Livewire/Project/Database/BackupEdit.php b/app/Livewire/Project/Database/BackupEdit.php
index 9ef6cb9ed2..9efb2d9fc8 100644
--- a/app/Livewire/Project/Database/BackupEdit.php
+++ b/app/Livewire/Project/Database/BackupEdit.php
@@ -14,7 +14,9 @@ class BackupEdit extends Component
public $s3s;
- public bool $delete_associated_backups = false;
+ public bool $delete_associated_backups_locally = false;
+ public bool $delete_associated_backups_s3 = false;
+ public bool $delete_associated_backups_sftp = false;
public ?string $status = null;
@@ -58,8 +60,11 @@ class BackupEdit extends Component
}
try {
- if ($this->delete_associated_backups) {
- $this->deleteAssociatedBackups();
+ if ($this->delete_associated_backups_locally) {
+ $this->deleteAssociatedBackupsLocally();
+ }
+ if ($this->delete_associated_backups_s3) {
+ $this->deleteAssociatedBackupsS3();
}
$this->backup->delete();
@@ -119,7 +124,7 @@ class BackupEdit extends Component
}
}
- public function deleteAssociatedBackups()
+ public function deleteAssociatedBackupsLocally()
{
$executions = $this->backup->executions;
$backupFolder = null;
@@ -144,6 +149,16 @@ class BackupEdit extends Component
}
}
+ public function deleteAssociatedBackupsS3()
+ {
+ //Add function to delete backups from S3
+ }
+
+ public function deleteAssociatedBackupsSftp()
+ {
+ //Add function to delete backups from SFTP
+ }
+
private function deleteEmptyBackupFolder($folderPath, $server)
{
$checkEmpty = instant_remote_process(["[ -z \"$(ls -A '$folderPath')\" ] && echo 'empty' || echo 'not empty'"], $server);
@@ -162,10 +177,11 @@ class BackupEdit extends Component
public function render()
{
- //Add delete backup form S3 storage and delete backup for SFTP... when it is implemented
return view('livewire.project.database.backup-edit', [
'checkboxes' => [
- ['id' => 'delete_associated_backups', 'label' => 'All backups associated with this backup job from this database will be permanently deleted from local storage.']
+ ['id' => 'delete_associated_backups_locally', 'label' => 'All backups associated with this backup job from this database will be permanently deleted from local storage.'],
+ // ['id' => 'delete_associated_backups_s3', 'label' => 'All backups associated with this backup job from this database will be permanently deleted from the selected S3 Storage.']
+ // ['id' => 'delete_associated_backups_sftp', 'label' => 'All backups associated with this backup job from this database will be permanently deleted from the selected SFTP Storage.']
]
]);
}
diff --git a/app/Livewire/Project/DeleteEnvironment.php b/app/Livewire/Project/DeleteEnvironment.php
index 7c60c64047..e01741770a 100644
--- a/app/Livewire/Project/DeleteEnvironment.php
+++ b/app/Livewire/Project/DeleteEnvironment.php
@@ -3,8 +3,6 @@
namespace App\Livewire\Project;
use App\Models\Environment;
-use Illuminate\Support\Facades\Auth;
-use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class DeleteEnvironment extends Component
@@ -23,12 +21,8 @@ class DeleteEnvironment extends Component
$this->environmentName = Environment::findOrFail($this->environment_id)->name;
}
- public function delete($password)
+ public function delete()
{
- if (!Hash::check($password, Auth::user()->password)) {
- $this->addError('password', 'The provided password is incorrect.');
- return;
- }
$this->validate([
'environment_id' => 'required|int',
]);
diff --git a/app/Livewire/Project/DeleteProject.php b/app/Livewire/Project/DeleteProject.php
index 75060f8f3a..360fad10a8 100644
--- a/app/Livewire/Project/DeleteProject.php
+++ b/app/Livewire/Project/DeleteProject.php
@@ -3,8 +3,6 @@
namespace App\Livewire\Project;
use App\Models\Project;
-use Illuminate\Support\Facades\Auth;
-use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class DeleteProject extends Component
@@ -23,12 +21,8 @@ class DeleteProject extends Component
$this->projectName = Project::findOrFail($this->project_id)->name;
}
- public function delete($password)
+ public function delete()
{
- if (!Hash::check($password, Auth::user()->password)) {
- $this->addError('password', 'The provided password is incorrect.');
- return;
- }
$this->validate([
'project_id' => 'required|int',
]);
diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php
index 9e3abac317..a726406cd1 100644
--- a/resources/views/components/modal-confirmation.blade.php
+++ b/resources/views/components/modal-confirmation.blade.php
@@ -64,7 +64,9 @@
const paramsMatch = this.submitAction.match(/\((.*?)\)/);
const params = paramsMatch ? paramsMatch[1].split(',').map(param => param.trim()) : [];
- params.push(this.password);
+ if (this.confirmWithPassword) {
+ params.push(this.password);
+ }
params.push(this.selectedActions);
$wire[methodName](...params)
@@ -162,14 +164,7 @@
<div class="px-2">Select the actions you want to perform:</div>
</div>
@foreach($checkboxes as $index => $checkbox)
- <x-forms.checkbox
- :id="$checkbox['id']"
- :wire:model="$checkbox['id']"
- :label="$checkbox['label']"
- x-on:change="toggleAction('{{ $checkbox['id'] }}')"
- :checked="$this->{$checkbox['id']}"
- x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
- ></x-forms.checkbox>
+ <x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']" :label="$checkbox['label']" x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}" x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"></x-forms.checkbox>
@endforeach
</div>
@endif
@@ -183,22 +178,22 @@
<div class="px-2 mb-4">The following actions will be performed:</div>
<ul class="mb-4 space-y-2">
@foreach($actions as $action)
+ <li class="flex items-center text-red-500">
+ <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
+ </svg>
+ <span>{{ $action }}</span>
+ </li>
+ @endforeach
+ @foreach($checkboxes as $checkbox)
+ <template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
<li class="flex items-center text-red-500">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
- <span>{{ $action }}</span>
+ <span>{{ $checkbox['label'] }}</span>
</li>
- @endforeach
- @foreach($checkboxes as $checkbox)
- <template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
- <li class="flex items-center text-red-500">
- <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
- </svg>
- <span>{{ $checkbox['label'] }}</span>
- </li>
- </template>
+ </template>
@endforeach
</ul>
@if($confirmWithText)
@@ -244,7 +239,7 @@
<input type="password" id="password-confirm" x-model="password" class="input w-full" placeholder="Enter your password">
<p x-show="passwordError" x-text="passwordError" class="text-red-500 text-sm mt-1"></p>
@error('password')
- <p class="text-red-500 text-sm mt-1">{{ $message }}</p>
+ <p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
</div>
@@ -263,29 +258,19 @@
</template>
<template x-if="step === 1">
- <x-forms.button @click="step++" class="w-auto" isError>
+ <x-forms.button @click="step++" class="w-auto" isError>
<span x-text="step1ButtonText"></span>
</x-forms.button>
</template>
<template x-if="step === 2">
- <x-forms.button
- @click="confirmWithPassword ? step++ : submitForm()"
- x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText"
- class="w-auto"
- isError
- >
- <span x-text="confirmWithPassword ? step2ButtonText : step3ButtonText"></span>
+ <x-forms.button @click="confirmWithPassword ? step++ : submitForm()" x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText" class="w-auto" isError>
+ <span x-text="step2ButtonText"></span>
</x-forms.button>
</template>
<template x-if="step === 3 && confirmWithPassword">
- <x-forms.button
- @click="submitForm()"
- class="w-auto"
- isError
- x-bind:disabled="!password"
- >
+ <x-forms.button @click="submitForm()" class="w-auto" isError x-bind:disabled="!password">
<span x-text="step3ButtonText"></span>
</x-forms.button>
</template>
diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php
index e4c0c3ad23..c1a8cad010 100644
--- a/resources/views/livewire/dashboard.blade.php
+++ b/resources/views/livewire/dashboard.blade.php
@@ -123,15 +123,14 @@
<x-loading />
@endif
<x-modal-confirmation
- title="Confirm Queues Cleanup"
+ title="Confirm Cleanup Queues?"
buttonTitle="Cleanup Queues"
isErrorButton
submitAction="cleanup_queue"
- :actions="['Cleanup all running Deployment Queues']"
- buttonTitle="Cleanup Queues"
+ :actions="['All running Deployment Queues will be cleaned up.']"
:confirmWithText="false"
:confirmWithPassword="false"
- step3ButtonText="Cleanup Deployment Queues"
+ step2ButtonText="Permanently Cleanup Deployment Queues"
/>
</div>
<div>
diff --git a/resources/views/livewire/destination/form.blade.php b/resources/views/livewire/destination/form.blade.php
index 06ca4eb13b..d6894060b4 100644
--- a/resources/views/livewire/destination/form.blade.php
+++ b/resources/views/livewire/destination/form.blade.php
@@ -15,9 +15,8 @@
confirmationText="{{ $destination->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Destination Name below"
shortConfirmationLabel="Destination Name"
- buttonTitle="Delete Destination"
- step3ButtonText="Permanently Delete Destination"
- :confirmWithPassword="true"
+ :confirmWithPassword="false"
+ step2ButtonText="Permanently Delete Destination"
/>
@endif
</div>
diff --git a/resources/views/livewire/project/database/backup-edit.blade.php b/resources/views/livewire/project/database/backup-edit.blade.php
index a737ec091e..81ecbbe742 100644
--- a/resources/views/livewire/project/database/backup-edit.blade.php
+++ b/resources/views/livewire/project/database/backup-edit.blade.php
@@ -10,14 +10,14 @@
@if ($backup->database_id !== 0)
<x-modal-confirmation
title="Confirm Backup Schedule Deletion?"
- buttonTitle="Delete"
+ buttonTitle="Delete Backups and Schedule"
isErrorButton
+ submitAction="delete"
:checkboxes="$checkboxes"
:actions="['The selected backup schedule will be deleted.', 'Scheduled backups for this database will be stopped (if this is the only backup schedule for this database).']"
confirmationText="{{ $backup->database->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Database Name of the scheduled backups below"
shortConfirmationLabel="Database Name"
- submitAction="delete"
/>
@endif
</div>
diff --git a/resources/views/livewire/project/database/backup-executions.blade.php b/resources/views/livewire/project/database/backup-executions.blade.php
index 978198b722..d7f74664f5 100644
--- a/resources/views/livewire/project/database/backup-executions.blade.php
+++ b/resources/views/livewire/project/database/backup-executions.blade.php
@@ -38,7 +38,6 @@
title="Confirm Backup Deletion?"
buttonTitle="Delete"
isErrorButton
- type="button"
submitAction="deleteBackup({{ data_get($execution, 'id') }})"
{{-- :checkboxes="$checkboxes" --}}
:actions="[
diff --git a/resources/views/livewire/project/delete-environment.blade.php b/resources/views/livewire/project/delete-environment.blade.php
index d405d66c11..f932ae4f7d 100644
--- a/resources/views/livewire/project/delete-environment.blade.php
+++ b/resources/views/livewire/project/delete-environment.blade.php
@@ -6,7 +6,7 @@
:actions="['This will delete the selected environment.']"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Name below"
shortConfirmationLabel="Environment Name"
- buttonTitle="Delete Environment"
confirmationText="{{ $environmentName }}"
- step3ButtonText="Permanently Delete Environment"
+ :confirmWithPassword="false"
+ step2ButtonText="Permanently Delete Environment"
/>
diff --git a/resources/views/livewire/project/delete-project.blade.php b/resources/views/livewire/project/delete-project.blade.php
index 990caaf920..8ce8221456 100644
--- a/resources/views/livewire/project/delete-project.blade.php
+++ b/resources/views/livewire/project/delete-project.blade.php
@@ -3,10 +3,10 @@
buttonTitle="Delete Project"
isErrorButton
submitAction="delete"
- :actions="['This will delete the selected project.']"
+ :actions="['This will delete the selected project', 'All Environments inside the project will be deleted as well.']"
confirmationLabel="Please confirm the execution of the actions by entering the Project Name below"
shortConfirmationLabel="Project Name"
- buttonTitle="Delete Project"
confirmationText="{{ $projectName }}"
- step3ButtonText="Permanently Delete Project"
+ :confirmWithPassword="false"
+ step2ButtonText="Permanently Delete Project"
/>