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.

Merge branch 'next' into fix-autocompletes

🏔️ Peak01bdde2f2bf7
diff --cc resources/views/components/modal-confirmation.blade.php
index adcae3eca2,b4818984c4..7d44b550ef
--- a/resources/views/components/modal-confirmation.blade.php
+++ b/resources/views/components/modal-confirmation.blade.php
@@@ -222,127 -249,127 +249,150 @@@
</template>
@endforeach
</ul>
- @if ($confirmWithText)
- <div class="mb-4">
- <h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
- <p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
- <div class="relative mb-2">
- <input type="text" x-model="confirmationText"
- class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
- <button @click="copyConfirmationText()"
- class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
- title="Copy confirmation text" x-ref="copyButton">
- <template x-if="!copied">
- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"
- fill="currentColor">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
- <path
- d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
- </svg>
- </template>
- <template x-if="copied">
- <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
- viewBox="0 0 20 20" fill="currentColor">
- <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" />
- </svg>
- </template>
- </button>
- </div>
+ @if (!$disableTwoStepConfirmation)
+ @if ($confirmWithText)
+ <div class="mb-4">
+ <h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
+ <p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
+ <div class="relative mb-2">
+ <input type="text" x-model="confirmationText"
+ class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
+ <button @click="copyConfirmationText()"
+ class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
+ title="Copy confirmation text" x-ref="copyButton">
+ <template x-if="!copied">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5"
+ viewBox="0 0 20 20" fill="currentColor">
+ <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
+ <path
+ d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
+ </svg>
+ </template>
+ <template x-if="copied">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
+ viewBox="0 0 20 20" fill="currentColor">
+ <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" />
+ </svg>
+ </template>
+ </button>
+ </div>
- <label for="userConfirmationText"
- class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
- {{ $shortConfirmationLabel }}
- </label>
- <input type="text" x-model="userConfirmationText"
- class="p-2 mt-1 w-full text-black rounded input">
- </div>
+ <label for="userConfirmationText"
+ class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
+ {{ $shortConfirmationLabel }}
+ </label>
+ <input type="text" x-model="userConfirmationText"
+ class="p-2 mt-1 w-full text-black rounded input">
+ </div>
+ @endif
@endif
- </div>
+ <!-- Step 3: Password confirmation -->
+ <div x-show="step === 3 && confirmWithPassword">
+ <div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
+ <p class="font-bold">Final Confirmation</p>
+ <p>Please enter your password to confirm this destructive action.</p>
+ </div>
+ <div class="flex flex-col gap-2 mb-4">
+ @php
+ $passwordConfirm = Str::uuid();
+ @endphp
+ <label for="password-confirm-{{ $passwordConfirm }}"
+ class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ Your Password
+ </label>
+ <form @submit.prevent="false" @keydown.enter.prevent>
+ <input type="text" name="username" autocomplete="username" value="{{ auth()->user()->email }}" style="display: none;">
+ <input type="password" id="password-confirm-{{ $passwordConfirm }}" x-model="password"
+ class="w-full input" placeholder="Enter your password" autocomplete="current-password">
+ </form>
+ <p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500"></p>
+ @error('password')
+ <p class="mt-1 text-sm text-red-500">{{ $message }}</p>
+ @enderror
- </div>
+ <div class="flex flex-wrap gap-2 justify-between mt-4">
+ @if (!empty($checkboxes))
+ <x-forms.button @click="step--"
+ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
+ Back
+ </x-forms.button>
+ @else
+ <x-forms.button @click="modalOpen = false; resetModal()"
+ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
+ Cancel
+ </x-forms.button>
+ @endif
+ <x-forms.button
+ x-bind:disabled="!disableTwoStepConfirmation && confirmWithText && userConfirmationText !==
+ confirmationText"
+ class="w-auto" isError
+ @click="
+ if (dispatchEvent) {
+ $wire.dispatch(dispatchEventType, dispatchEventMessage);
+ }
+ if (confirmWithPassword && !disableTwoStepConfirmation) {
+ step++;
+ } else {
+ modalOpen = false;
+ resetModal();
+ submitForm();
+ }
+ ">
+ <span x-text="step2ButtonText"></span>
+ </x-forms.button>
- </div>
++ </div>
</div>
- </div>
- <!-- Navigation buttons -->
- <div class="flex flex-wrap gap-2 justify-between mt-4">
- <template x-if="step > initialStep">
- <x-forms.button @click="step--" class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
- Back
- </x-forms.button>
- </template>
- <template x-if="step === initialStep">
- <x-forms.button @click="modalOpen = false; resetModal()"
- class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
- Cancel
- </x-forms.button>
- </template>
-
- <template x-if="step === 1">
- <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 x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText"
- class="w-auto" isError
- @click="
- if (dispatchEvent) {
- $wire.dispatch(dispatchEventType, dispatchEventMessage);
- }
- if (confirmWithPassword) {
- step++;
- } else {
- modalOpen = false;
- resetModal();
- submitForm();
- }">
- <span x-text="step2ButtonText"></span>
- </x-forms.button>
- </template>
+ <!-- Step 3: Password confirmation -->
+ @if (!$disableTwoStepConfirmation)
+ <div x-show="step === 3 && confirmWithPassword">
+ <div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
+ <p class="font-bold">Final Confirmation</p>
+ <p>Please enter your password to confirm this destructive action.</p>
+ </div>
+ <div class="flex flex-col gap-2 mb-4">
+ <label for="password-confirm"
+ class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ Your Password
+ </label>
+ <form @submit.prevent @keydown.enter.prevent>
+ <input type="password" id="password-confirm" x-model="password"
+ class="w-full input" placeholder="Enter your password">
+ </form>
+ <p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500">
+ </p>
+ @error('password')
+ <p class="mt-1 text-sm text-red-500">{{ $message }}</p>
+ @enderror
+ </div>
- <template x-if="step === 3 && confirmWithPassword">
- <x-forms.button x-bind:disabled="!password" class="w-auto" isError
- @click="
- if (dispatchEvent) {
- $wire.dispatch(dispatchEventType, dispatchEventMessage);
- }
- submitForm().then((result) => {
- if (result === true) {
- modalOpen = false;
- resetModal();
- } else {
- passwordError = result;
- }
- });
- ">
- <span x-text="step3ButtonText"></span>
- </x-forms.button>
- </template>
+ <div class="flex flex-wrap gap-2 justify-between mt-4">
+ <x-forms.button @click="step--"
+ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
+ Back
+ </x-forms.button>
+ <x-forms.button x-bind:disabled="!password" class="w-auto" isError
+ @click="
+ if (dispatchEvent) {
+ $wire.dispatch(dispatchEventType, dispatchEventMessage);
+ }
+ submitForm().then((result) => {
+ if (result === true) {
+ modalOpen = false;
+ resetModal();
+ } else {
+ passwordError = result;
+ password = ''; // Clear the password field
+ }
+ });
+ ">
+ <span x-text="step3ButtonText"></span>
+ </x-forms.button>
+ </div>
+ </div>
+ @endif
</div>
</div>
</div>