Merge pull request #3934 from peaklabs-dev/disable-2-step-confirmation-if-needed

Feat: Ability to disable tow step confirmation
This commit is contained in:
Andras Bacsai
2024-10-21 10:58:13 +02:00
committed by GitHub
7 changed files with 257 additions and 170 deletions

View File

@@ -25,6 +25,10 @@ class Index extends Component
public string $update_check_frequency; public string $update_check_frequency;
public $timezones;
public bool $disable_two_step_confirmation;
protected string $dynamic_config_path = '/data/coolify/proxy/dynamic'; protected string $dynamic_config_path = '/data/coolify/proxy/dynamic';
protected Server $server; protected Server $server;
@@ -70,6 +74,7 @@ class Index extends Component
$this->auto_update_frequency = $this->settings->auto_update_frequency; $this->auto_update_frequency = $this->settings->auto_update_frequency;
$this->update_check_frequency = $this->settings->update_check_frequency; $this->update_check_frequency = $this->settings->update_check_frequency;
$this->timezones = collect(timezone_identifiers_list())->sort()->values()->toArray(); $this->timezones = collect(timezone_identifiers_list())->sort()->values()->toArray();
$this->disable_two_step_confirmation = $this->settings->disable_two_step_confirmation;
} else { } else {
return redirect()->route('dashboard'); return redirect()->route('dashboard');
} }
@@ -84,6 +89,7 @@ class Index extends Component
$this->settings->is_api_enabled = $this->is_api_enabled; $this->settings->is_api_enabled = $this->is_api_enabled;
$this->settings->auto_update_frequency = $this->auto_update_frequency; $this->settings->auto_update_frequency = $this->auto_update_frequency;
$this->settings->update_check_frequency = $this->update_check_frequency; $this->settings->update_check_frequency = $this->update_check_frequency;
$this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation;
$this->settings->save(); $this->settings->save();
$this->dispatch('success', 'Settings updated!'); $this->dispatch('success', 'Settings updated!');
} }
@@ -175,4 +181,12 @@ class Index extends Component
{ {
return view('livewire.settings.index'); return view('livewire.settings.index');
} }
public function toggleTwoStepConfirmation()
{
$this->settings->disable_two_step_confirmation = true;
$this->settings->save();
$this->disable_two_step_confirmation = true;
$this->dispatch('success', 'Two step confirmation has been disabled.');
}
} }

View File

@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::table('instance_settings', function (Blueprint $table) {
$table->boolean('disable_two_step_confirmation')->default(false);
});
}
public function down()
{
Schema::table('instance_settings', function (Blueprint $table) {
$table->dropColumn('disable_two_step_confirmation');
});
}
};

View File

@@ -26,6 +26,7 @@ class DatabaseSeeder extends Seeder
S3StorageSeeder::class, S3StorageSeeder::class,
StandalonePostgresqlSeeder::class, StandalonePostgresqlSeeder::class,
OauthSettingSeeder::class, OauthSettingSeeder::class,
DisableTwoStepConfirmationSeeder::class,
SentinelSeeder::class, SentinelSeeder::class,
]); ]);
} }

View File

@@ -0,0 +1,20 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DisableTwoStepConfirmationSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('instance_settings')->updateOrInsert(
[],
['disable_two_step_confirmation' => true]
);
}
}

View File

@@ -22,18 +22,23 @@
'dispatchEventMessage' => '', 'dispatchEventMessage' => '',
]) ])
@php
$settings = instanceSettings();
$disableTwoStepConfirmation = $settings->disable_two_step_confirmation ?? false;
@endphp
<div x-data="{ <div x-data="{
modalOpen: false, modalOpen: false,
step: {{ empty($checkboxes) ? 2 : 1 }}, step: {{ empty($checkboxes) ? 2 : 1 }},
initialStep: {{ empty($checkboxes) ? 2 : 1 }}, initialStep: {{ empty($checkboxes) ? 2 : 1 }},
finalStep: {{ $confirmWithPassword ? 3 : 2 }}, finalStep: {{ $confirmWithPassword && !$disableTwoStepConfirmation ? 3 : 2 }},
deleteText: '', deleteText: '',
password: '', password: '',
actions: @js($actions), actions: @js($actions),
confirmationText: @js($confirmationText), confirmationText: @js($confirmationText),
userConfirmationText: '', userConfirmationText: '',
confirmWithText: @js($confirmWithText), confirmWithText: @js($confirmWithText && !$disableTwoStepConfirmation),
confirmWithPassword: @js($confirmWithPassword), confirmWithPassword: @js($confirmWithPassword && !$disableTwoStepConfirmation),
copied: false, copied: false,
submitAction: @js($submitAction), submitAction: @js($submitAction),
passwordError: '', passwordError: '',
@@ -41,6 +46,7 @@
dispatchEvent: @js($dispatchEvent), dispatchEvent: @js($dispatchEvent),
dispatchEventType: @js($dispatchEventType), dispatchEventType: @js($dispatchEventType),
dispatchEventMessage: @js($dispatchEventMessage), dispatchEventMessage: @js($dispatchEventMessage),
disableTwoStepConfirmation: @js($disableTwoStepConfirmation),
resetModal() { resetModal() {
this.step = this.initialStep; this.step = this.initialStep;
this.deleteText = ''; this.deleteText = '';
@@ -222,66 +228,70 @@
</template> </template>
@endforeach @endforeach
</ul> </ul>
@if ($confirmWithText) @if (!$disableTwoStepConfirmation)
<div class="mb-4"> @if ($confirmWithText)
<h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4> <div class="mb-4">
<p class="mb-2 text-sm">{{ $confirmationLabel }}</p> <h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
<div class="relative mb-2"> <p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
<input type="text" x-model="confirmationText" <div class="relative mb-2">
class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly> <input type="text" x-model="confirmationText"
<button @click="copyConfirmationText()" class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700" <button @click="copyConfirmationText()"
title="Copy confirmation text" x-ref="copyButton"> class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
<template x-if="!copied"> title="Copy confirmation text" x-ref="copyButton">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20" <template x-if="!copied">
fill="currentColor"> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"
<path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" /> fill="currentColor">
<path <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
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" /> <path
</svg> 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" />
</template> </svg>
<template x-if="copied"> </template>
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500" <template x-if="copied">
viewBox="0 0 20 20" fill="currentColor"> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
<path fill-rule="evenodd" viewBox="0 0 20 20" fill="currentColor">
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" <path fill-rule="evenodd"
clip-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"
</svg> clip-rule="evenodd" />
</template> </svg>
</button> </template>
</div> </button>
</div>
<label for="userConfirmationText" <label for="userConfirmationText"
class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300"> class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
{{ $shortConfirmationLabel }} {{ $shortConfirmationLabel }}
</label> </label>
<input type="text" x-model="userConfirmationText" <input type="text" x-model="userConfirmationText"
class="p-2 mt-1 w-full text-black rounded input"> class="p-2 mt-1 w-full text-black rounded input">
</div> </div>
@endif
@endif @endif
</div> </div>
<!-- Step 3: Password confirmation --> <!-- Step 3: Password confirmation -->
<div x-show="step === 3 && confirmWithPassword"> @if (!$disableTwoStepConfirmation)
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert"> <div x-show="step === 3 && confirmWithPassword">
<p class="font-bold">Final Confirmation</p> <div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
<p>Please enter your password to confirm this destructive action.</p> <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>
</div> </div>
<div class="flex flex-col gap-2 mb-4"> @endif
<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>
</div>
</div> </div>
<!-- Navigation buttons --> <!-- Navigation buttons -->
<div class="flex flex-wrap gap-2 justify-between mt-4"> <div class="flex flex-wrap gap-2 justify-between mt-4">
@@ -304,41 +314,47 @@
</template> </template>
<template x-if="step === 2"> <template x-if="step === 2">
<x-forms.button x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText" <x-forms.button
class="w-auto" isError x-bind:disabled="!disableTwoStepConfirmation && confirmWithText && userConfirmationText !== confirmationText"
class="w-auto"
isError
@click=" @click="
if (dispatchEvent) { if (dispatchEvent) {
$wire.dispatch(dispatchEventType, dispatchEventMessage); $wire.dispatch(dispatchEventType, dispatchEventMessage);
} }
if (confirmWithPassword) { if (confirmWithPassword) {
step++; step++;
} else { } else {
modalOpen = false; modalOpen = false;
resetModal(); resetModal();
submitForm(); submitForm();
}"> }
<span x-text="step2ButtonText"></span> "
>
<span x-text="disableTwoStepConfirmation ? step2ButtonText : 'Permanently Delete'"></span>
</x-forms.button> </x-forms.button>
</template> </template>
<template x-if="step === 3 && confirmWithPassword"> @if (!$disableTwoStepConfirmation)
<x-forms.button x-bind:disabled="!password" class="w-auto" isError <template x-if="step === 3 && confirmWithPassword">
@click=" <x-forms.button x-bind:disabled="!password" class="w-auto" isError
if (dispatchEvent) { @click="
$wire.dispatch(dispatchEventType, dispatchEventMessage); if (dispatchEvent) {
} $wire.dispatch(dispatchEventType, dispatchEventMessage);
submitForm().then((result) => {
if (result === true) {
modalOpen = false;
resetModal();
} else {
passwordError = result;
} }
}); submitForm().then((result) => {
"> if (result === true) {
<span x-text="step3ButtonText"></span> modalOpen = false;
</x-forms.button> resetModal();
</template> } else {
passwordError = result;
}
});
">
<span x-text="step3ButtonText"></span>
</x-forms.button>
</template>
@endif
</div> </div>
</div> </div>
</div> </div>

View File

@@ -16,7 +16,7 @@
<x-modal-confirmation title="Confirm Server Deletion?" isErrorButton buttonTitle="Delete" <x-modal-confirmation title="Confirm Server Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete" :actions="['This server will be permanently deleted.']" confirmationText="{{ $server->name }}" submitAction="delete" :actions="['This server will be permanently deleted.']" confirmationText="{{ $server->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Server Name below" confirmationLabel="Please confirm the execution of the actions by entering the Server Name below"
shortConfirmationLabel="Server Name" step2ButtonText="Continue" step3ButtonText="Permanently Delete" /> shortConfirmationLabel="Server Name" step3ButtonText="Permanently Delete" />
@endif @endif
@endif @endif
</div> </div>

View File

@@ -1,26 +1,24 @@
<div> <div>
<x-slot:title> <x-slot:title>
Settings | Coolify Settings | Coolify
</x-slot> </x-slot>
<x-settings.navbar /> <x-settings.navbar />
<form wire:submit='submit' class="flex flex-col"> <form wire:submit='submit' class="flex flex-col">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<h2>Configuration</h2> <h2>Configuration</h2>
<x-forms.button type="submit"> <x-forms.button type="submit">
Save Save
</x-forms.button> </x-forms.button>
</div> </div>
<div>General configuration for your Coolify instance.</div> <div>General configuration for your Coolify instance.</div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<h4 class="pt-6">Instance Settings</h4> <h4 class="pt-6">Instance Settings</h4>
<div class="flex flex-wrap items-end gap-2"> <div class="flex flex-wrap items-end gap-2">
<div class="flex gap-2 md:flex-row flex-col w-full"> <div class="flex gap-2 md:flex-row flex-col w-full">
<x-forms.input id="settings.fqdn" label="Instance's Domain" <x-forms.input id="settings.fqdn" label="Instance's Domain" helper="Enter the full domain name (FQDN) of the instance, including 'https://' if you want to secure the dashboard with HTTPS. Setting this will make the dashboard accessible via this domain, secured by HTTPS, instead of just the IP address." placeholder="https://coolify.yourdomain.com" />
helper="Enter the full domain name (FQDN) of the instance, including 'https://' if you want to secure the dashboard with HTTPS. Setting this will make the dashboard accessible via this domain, secured by HTTPS, instead of just the IP address." <x-forms.input id="settings.instance_name" label="Instance's Name" placeholder="Coolify" />
placeholder="https://coolify.yourdomain.com" /> <div class="w-full" x-data="{
<x-forms.input id="settings.instance_name" label="Instance's Name" placeholder="Coolify" />
<div class="w-full" x-data="{
open: false, open: false,
search: '{{ $settings->instance_timezone ?: '' }}', search: '{{ $settings->instance_timezone ?: '' }}',
timezones: @js($timezones), timezones: @js($timezones),
@@ -33,62 +31,45 @@
}) })
} }
}"> }">
<div class="flex items-center mb-1"> <div class="flex items-center mb-1">
<label for="settings.instance_timezone">Instance <label for="settings.instance_timezone">Instance
Timezone</label> Timezone</label>
<x-helper class="ml-2" <x-helper class="ml-2" helper="Timezone for the Coolify instance. This is used for the update check and automatic update frequency." />
helper="Timezone for the Coolify instance. This is used for the update check and automatic update frequency." />
</div>
<div class="relative">
<div class="inline-flex items-center relative w-full">
<input autocomplete="off" wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300'
wire:dirty.class="dark:focus:ring-warning dark:ring-warning" x-model="search"
@focus="open = true" @click.away="open = false" @input="open = true"
class="w-full input " :placeholder="placeholder"
wire:model.debounce.300ms="settings.instance_timezone">
<svg class="absolute right-0 w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
@click="open = true">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" />
</svg>
</div> </div>
<div x-show="open" <div class="relative">
class="absolute z-50 w-full mt-1 bg-white dark:bg-coolgray-100 border dark:border-coolgray-200 rounded-md shadow-lg max-h-60 overflow-auto scrollbar overflow-x-hidden"> <div class="inline-flex items-center relative w-full">
<template <input autocomplete="off" wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300' wire:dirty.class="dark:focus:ring-warning dark:ring-warning" x-model="search" @focus="open = true" @click.away="open = false" @input="open = true" class="w-full input " :placeholder="placeholder" wire:model.debounce.300ms="settings.instance_timezone">
x-for="timezone in timezones.filter(tz => tz.toLowerCase().includes(search.toLowerCase()))" <svg class="absolute right-0 w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" @click="open = true">
:key="timezone"> <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" />
<div @click="search = timezone; open = false; $wire.set('settings.instance_timezone', timezone)" </svg>
class="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-coolgray-300 text-gray-800 dark:text-gray-200" </div>
x-text="timezone"></div> <div x-show="open" class="absolute z-50 w-full mt-1 bg-white dark:bg-coolgray-100 border dark:border-coolgray-200 rounded-md shadow-lg max-h-60 overflow-auto scrollbar overflow-x-hidden">
</template> <template x-for="timezone in timezones.filter(tz => tz.toLowerCase().includes(search.toLowerCase()))" :key="timezone">
<div @click="search = timezone; open = false; $wire.set('settings.instance_timezone', timezone)" class="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-coolgray-300 text-gray-800 dark:text-gray-200" x-text="timezone"></div>
</template>
</div>
</div> </div>
</div> </div>
</div> </div>
<h4 class="w-full pt-6">DNS Validation</h4>
<div class="md:w-96">
<x-forms.checkbox instantSave id="is_dns_validation_enabled" label="Enabled" />
</div>
<x-forms.input id="settings.custom_dns_servers" label="DNS Servers" helper="DNS servers to validate FQDNs against. A comma separated list of DNS servers." placeholder="1.1.1.1,8.8.8.8" />
</div> </div>
<h4 class="w-full pt-6">DNS Validation</h4> {{-- <div class="flex gap-2 ">
<div class="md:w-96">
<x-forms.checkbox instantSave id="is_dns_validation_enabled" label="Enabled" />
</div>
<x-forms.input id="settings.custom_dns_servers" label="DNS Servers"
helper="DNS servers to validate FQDNs against. A comma separated list of DNS servers."
placeholder="1.1.1.1,8.8.8.8" />
</div>
{{-- <div class="flex gap-2 ">
<x-forms.input type="number" id="settings.public_port_min" label="Public Port Min" /> <x-forms.input type="number" id="settings.public_port_min" label="Public Port Min" />
<x-forms.input type="number" id="settings.public_port_max" label="Public Port Max" /> <x-forms.input type="number" id="settings.public_port_max" label="Public Port Max" />
</div> --}} </div> --}}
</div> </div>
<h4 class="pt-6">API</h4> <h4 class="pt-6">API</h4>
<div class="md:w-96"> <div class="md:w-96">
<x-forms.checkbox instantSave id="is_api_enabled" label="Enabled" /> <x-forms.checkbox instantSave id="is_api_enabled" label="Enabled" />
</div> </div>
<x-forms.input id="settings.allowed_ips" label="Allowed IPs" <x-forms.input id="settings.allowed_ips" label="Allowed IPs" helper="Allowed IP lists for the API. A comma separated list of IPs. Empty means you allow from everywhere." placeholder="1.1.1.1,8.8.8.8" />
helper="Allowed IP lists for the API. A comma separated list of IPs. Empty means you allow from everywhere."
placeholder="1.1.1.1,8.8.8.8" />
<h4 class="pt-6">Advanced</h4> <h4 class="pt-6">Advanced</h4>
<div class="text-right md:w-96"> <div class="text-right md:w-96">
@@ -99,26 +80,59 @@
<div class="text-right md:w-96"> <div class="text-right md:w-96">
@if (!is_null(env('AUTOUPDATE', null))) @if (!is_null(env('AUTOUPDATE', null)))
<div class="text-right md:w-96"> <div class="text-right md:w-96">
<x-forms.checkbox instantSave helper="AUTOUPDATE is set in .env file, you need to modify it there." <x-forms.checkbox instantSave helper="AUTOUPDATE is set in .env file, you need to modify it there." disabled id="is_auto_update_enabled" label="Enabled" />
disabled id="is_auto_update_enabled" label="Enabled" />
</div> </div>
@else @else
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Enabled" /> <x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Enabled" />
@endif @endif
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div class="flex items-end gap-2"> <div class="flex items-end gap-2">
<x-forms.input required id="update_check_frequency" label="Update Check Frequency" <x-forms.input required id="update_check_frequency" label="Update Check Frequency" placeholder="0 * * * *" helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every hour." />
placeholder="0 * * * *" <x-forms.button wire:click='checkManually'>Check Manually</x-forms.button>
helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every hour." /> </div>
<x-forms.button wire:click='checkManually'>Check Manually</x-forms.button>
@if (is_null(env('AUTOUPDATE', null)) && $is_auto_update_enabled)
<x-forms.input required id="auto_update_frequency" label="Auto Update Frequency" placeholder="0 0 * * *" helper="Cron expression for auto update frequency (automatically update coolify).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every day at 00:00" />
@endif
</div> </div>
@if (is_null(env('AUTOUPDATE', null)) && $is_auto_update_enabled) <h4 class="pt-6">Advanced</h4>
<x-forms.input required id="auto_update_frequency" label="Auto Update Frequency" placeholder="0 0 * * *" <div class="text-right md:w-96">
helper="Cron expression for auto update frequency (automatically update coolify).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every day at 00:00" /> <x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
@endif <x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
</div> </div>
</form>
<h5 class="pt-4 font-bold text-white">Confirmation Settings</h5>
<div x-data="{ open: false }" class="md:w-96">
<button type="button" @click="open = !open" class="flex items-center justify-between w-full py-2 text-left">
<span>Confirmation Options</span>
<svg :class="{'rotate-180': open}" class="w-5 h-5 transition-transform duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</button>
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="mt-2">
<div class="mb-4 p-4 bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700">
<p class="font-bold">Warning!</p>
<p>Disabling two step confirmation reduces security (as anyone can easily delete anything) and increases the risk of accidental actions. This is not recommended for production servers.</p>
</div>
@if($disable_two_step_confirmation)
<x-forms.checkbox instantSave id="disable_two_step_confirmation" label="Disable Two Step Confirmation" helper="When disabled, you will not need to confirm actions with a text and user password. This significantly reduces security and may lead to accidental deletions or unwanted changes. Use with extreme caution, especially on production servers." />
@else
<x-modal-confirmation
title="Disable Two Step Confirmation?"
buttonTitle="Disable Two Step Confirmation"
isErrorButton
submitAction="toggleTwoStepConfirmation"
:actions="['Tow Step confimation will be disabled globally.', 'Disabling two step confirmation reduces security (as anyone can easily delete anything).', 'The risk of accidental actions will increase.']"
confirmationText="DISABLE TWO STEP CONFIRMATION"
confirmationLabel="Please type the confirmation text to disable two step confirmation."
shortConfirmationLabel="Confirmation text"
step3ButtonText="Disable Two Step Confirmation"
/>
@endif
</div>
</div>
</form>
</div> </div>