fixes here and there

This commit is contained in:
ayntk-ai
2024-09-02 19:27:21 +02:00
parent 843e3fb599
commit dfd218ec06
11 changed files with 58 additions and 79 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -38,7 +38,6 @@
title="Confirm Backup Deletion?"
buttonTitle="Delete"
isErrorButton
type="button"
submitAction="deleteBackup({{ data_get($execution, 'id') }})"
{{-- :checkboxes="$checkboxes" --}}
:actions="[

View File

@@ -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"
/>

View File

@@ -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"
/>