fix: settings view

feat: add separate views for settings
This commit is contained in:
Andras Bacsai
2024-08-06 14:36:56 +02:00
parent c4436aadfa
commit b77171d2f2
13 changed files with 301 additions and 334 deletions

View File

@@ -13,6 +13,18 @@
<button>Resale License</button>
</a>
@endif
<a class="{{ request()->routeIs('settings.backup') ? 'dark:text-white' : '' }}"
href="{{ route('settings.backup') }}">
<button>Backup</button>
</a>
<a class="{{ request()->routeIs('settings.email') ? 'dark:text-white' : '' }}"
href="{{ route('settings.email') }}">
<button>Transactional Email</button>
</a>
<a class="{{ request()->routeIs('settings.oauth') ? 'dark:text-white' : '' }}"
href="{{ route('settings.oauth') }}">
<button>OAuth</button>
</a>
<div class="flex-1"></div>
</nav>
</div>

View File

@@ -1,4 +1,8 @@
<div>
<x-slot:title>
Settings | Coolify
</x-slot>
<x-settings.navbar />
<div class="flex flex-col">
<div class="flex items-center gap-2">
<h2>Backup</h2>
@@ -8,7 +12,7 @@
</x-forms.button>
@endif
</div>
<div class="pb-4">Backup your Coolify instance settings</div>
<div class="pb-4">Backup configuration for Coolify instance.</div>
<div>
@if (isset($database))
<div class="flex flex-col gap-3 pb-4">

View File

@@ -1,4 +1,8 @@
<div>
<x-slot:title>
Settings | Coolify
</x-slot>
<x-settings.navbar />
<div class="flex items-center gap-2">
<h2>Transactional Email</h2>
</div>

View File

@@ -1,4 +1,8 @@
<div>
<x-slot:title>
Settings | Coolify
</x-slot>
<x-settings.navbar />
<form wire:submit='submit' class="flex flex-col">
<div class="flex flex-col">
<div class="flex items-center gap-2">
@@ -7,20 +11,26 @@
Save
</x-forms.button>
</div>
<div class="pb-4 ">Custom authentication (OAuth) configurations.</div>
</div>
<div class="flex flex-col gap-2 pt-4">
@foreach ($oauth_settings_map as $oauth_setting)
<div class="p-4 border dark:border-coolgray-300">
<h3>{{ucfirst($oauth_setting->provider)}} Oauth</h3>
<h3>{{ ucfirst($oauth_setting->provider) }} Oauth</h3>
<div class="w-32">
<x-forms.checkbox instantSave id="oauth_settings_map.{{$oauth_setting->provider}}.enabled" label="Enabled" />
<x-forms.checkbox instantSave id="oauth_settings_map.{{ $oauth_setting->provider }}.enabled"
label="Enabled" />
</div>
<div class="flex flex-col w-full gap-2 xl:flex-row">
<x-forms.input id="oauth_settings_map.{{$oauth_setting->provider}}.client_id" label="Client ID" />
<x-forms.input id="oauth_settings_map.{{$oauth_setting->provider}}.client_secret" type="password" label="Client Secret" />
<x-forms.input id="oauth_settings_map.{{$oauth_setting->provider}}.redirect_uri" label="Redirect URI" />
<x-forms.input id="oauth_settings_map.{{ $oauth_setting->provider }}.client_id"
label="Client ID" />
<x-forms.input id="oauth_settings_map.{{ $oauth_setting->provider }}.client_secret"
type="password" label="Client Secret" />
<x-forms.input id="oauth_settings_map.{{ $oauth_setting->provider }}.redirect_uri"
label="Redirect URI" />
@if ($oauth_setting->provider == 'azure')
<x-forms.input id="oauth_settings_map.{{$oauth_setting->provider}}.tenant" label="Tenant" />
<x-forms.input id="oauth_settings_map.{{ $oauth_setting->provider }}.tenant"
label="Tenant" />
@endif
</div>
</div>

View File

@@ -1,55 +0,0 @@
<div>
<form wire:submit='submit' class="flex flex-col">
<div class="flex items-center gap-2">
<h2>Configuration</h2>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<div>General configuration for your Coolify instance.</div>
<div class="flex flex-col gap-2 pt-4">
<div class="flex flex-wrap items-end gap-2">
<h3 class="pt-6">Instance Settings</h3>
<x-forms.input id="settings.fqdn" label="Instance's Domain" placeholder="https://coolify.io" />
<x-forms.input id="settings.instance_name" label="Instance's Name" placeholder="Coolify" />
<h3 class="pt-6 w-full">DNS Validation</h3>
<div class="flex flex-wrap items-end gap-2 md:w-96">
<x-forms.checkbox instantSave id="is_dns_validation_enabled" label="Enable DNS validation" />
</div>
<x-forms.input id="settings.custom_dns_servers" label="DNS Servers"
helper="DNS servers for validation FQDNs againts. 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_max" label="Public Port Max" />
</div> --}}
</div>
<h3 class="pt-6">API</h3>
<div class="md:w-96">
<x-forms.checkbox instantSave id="is_api_enabled" label="Enabled" />
</div>
<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" />
</form>
<h2 class="pt-6">Advanced</h2>
<div class="text-right md:w-96">
@if (!is_null(env('AUTOUPDATE', null)))
<x-forms.checkbox instantSave helper="AUTOUPDATE is set in .env file, you need to modify it there." disabled
id="is_auto_update_enabled" label="Auto Update Coolify" />
@else
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" />
@if($is_auto_update_enabled)
<x-forms.input id="auto_update_frequency" label="Auto Update Frequency" placeholder="0 0 * * *" helper="Cron expression for auto update frequency (automatically update coolify). Default is every day at 00:00" />
@endif
<x-forms.input id="update_check_frequency" label="Update Check Frequency" placeholder="0 */11 * * *" helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN). Default is every 12 hours at 11:00 and 23:00" />
@endif
<x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
<x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
</div>
</div>

View File

@@ -3,32 +3,70 @@
Settings | Coolify
</x-slot>
<x-settings.navbar />
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex flex-col h-full gap-8 pt-1 sm:flex-row">
<div class="flex gap-6 overflow-x-scroll sm:gap-2 sm:overflow-x-hidden scrollbar sm:flex-col whitespace-nowrap">
<a class="menu-item" :class="activeTab === 'general' && 'menu-item-active'"
@click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
<a class="menu-item" :class="activeTab === 'backup' && 'menu-item-active'"
@click.prevent="activeTab = 'backup'; window.location.hash = 'backup'" href="#">Instance Backup</a>
<a class="menu-item" :class="activeTab === 'smtp' && 'menu-item-active'"
@click.prevent="activeTab = 'smtp'; window.location.hash = 'smtp'" href="#">Transactional
Email</a>
<a class="menu-item" :class="activeTab === 'auth' && 'menu-item-active'"
@click.prevent="activeTab = 'auth'; window.location.hash = 'auth'" href="#">Authentication
(OAuth)</a>
<form wire:submit='submit' class="flex flex-col">
<div class="flex items-center gap-2">
<h2>Configuration</h2>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<div class="w-full">
<div x-cloak x-show="activeTab === 'general'" class="h-full">
<livewire:settings.configuration :settings="$settings" />
</div>
<div x-cloak x-show="activeTab === 'backup'" class="h-full">
<livewire:settings.backup :settings="$settings" :database="$database" :s3s="$s3s" />
</div>
<div x-cloak x-show="activeTab === 'smtp'" class="h-full">
<livewire:settings.email :settings="$settings" />
</div>
<div x-cloak x-show="activeTab === 'auth'" class="h-full">
<livewire:settings.auth />
<div>General configuration for your Coolify instance.</div>
<div class="flex flex-col gap-2">
<div class="flex flex-wrap items-end gap-2">
<h4 class="pt-6">Instance Settings</h4>
<x-forms.input id="settings.fqdn" label="Instance's Domain" placeholder="https://coolify.io" />
<x-forms.input id="settings.instance_name" label="Instance's Name" placeholder="Coolify" />
<h4 class="w-full pt-6">DNS Validation</h4>
<div class="flex flex-wrap items-end gap-2 md:w-96">
<x-forms.checkbox instantSave id="is_dns_validation_enabled" label="Enable DNS validation" />
</div>
<x-forms.input id="settings.custom_dns_servers" label="DNS Servers"
helper="DNS servers for validation FQDNs againts. 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_max" label="Public Port Max" />
</div> --}}
</div>
<h4 class="pt-6">API</h4>
<div class="md:w-96">
<x-forms.checkbox instantSave id="is_api_enabled" label="Enabled" />
</div>
<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" />
</form>
<h4 class="pt-6">Advanced</h4>
<h5 class="pt-4 font-bold text-white">Auto Update</h5>
@if (!is_null(env('AUTOUPDATE', null)))
<div class="text-right md:w-96">
<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" />
</div>
@else
<div class="text-right md:w-96">
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Enabled" />
</div>
<div class="flex gap-2 ">
@if ($is_auto_update_enabled)
<x-forms.input id="auto_update_frequency" label="Auto Update Frequency" placeholder="0 0 * * *"
helper="Cron expression for auto update frequency (automatically update coolify). Default is every day at 00:00" />
@endif
<x-forms.input id="update_check_frequency" label="Update Check Frequency" placeholder="0 */11 * * *"
helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN). Default is every 12 hours at 11:00 and 23:00" />
</div>
@endif
<h5 class="pt-4 font-bold text-white">Others</h5>
<div class="text-right md:w-96">
<x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
<x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
</div>
</div>
</div>