chore: Update server form layout and settings

This commit is contained in:
Andras Bacsai
2024-09-06 08:46:27 +02:00
parent 321b8559e0
commit b44f4e49e8

View File

@@ -178,64 +178,58 @@
</x-modal-input> </x-modal-input>
@endif @endif
@endif @endif
</div> </div>
</div> </div>
@if ($server->isFunctional()) @if ($server->isFunctional())
<h3 class="pt-4">Settings</h3> <h3 class="pt-4">Settings</h3>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-1">
<div class="flex flex-col flex-wrap gap-2 sm:flex-nowrap"> <div class="flex flex-col gap-2">
<div class="w-64"> <div class="flex flex-col flex-wrap gap-2 sm:flex-nowrap">
<x-forms.checkbox <div class="w-64">
helper="Enable force Docker Cleanup. This will cleanup build caches / unused images / etc." <x-forms.checkbox
instantSave id="server.settings.force_docker_cleanup" label="Force Docker Cleanup" /> helper="Enable force Docker Cleanup. This will cleanup build caches / unused images / etc."
instantSave id="server.settings.force_docker_cleanup" label="Force Docker Cleanup" />
</div>
@if ($server->settings->force_docker_cleanup)
<x-forms.input placeholder="*/10 * * * *" id="server.settings.docker_cleanup_frequency"
label="Docker cleanup frequency" required
helper="Cron expression for Docker Cleanup.<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every 10 minutes." />
@else
<x-forms.input id="server.settings.docker_cleanup_threshold"
label="Docker cleanup threshold (%)" required
helper="The Docker cleanup tasks will run when the disk usage exceeds this threshold." />
@endif
</div> </div>
@if ($server->settings->force_docker_cleanup)
<x-forms.input placeholder="*/10 * * * *" id="server.settings.docker_cleanup_frequency"
label="Docker cleanup frequency" required
helper="Cron expression for Docker Cleanup.<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every 10 minutes." />
@else
<x-forms.input id="server.settings.docker_cleanup_threshold"
label="Docker cleanup threshold (%)" required
helper="The Docker cleanup tasks will run when the disk usage exceeds this threshold." />
@endif
</div> </div>
@else <div class="flex flex-wrap gap-2 sm:flex-nowrap">
<x-forms.input id="cleanup_after_percentage" label="Disk cleanup threshold (%)" required <x-forms.input id="server.settings.concurrent_builds" label="Number of concurrent builds" required
helper="The disk cleanup task will run when the disk usage exceeds this threshold." /> helper="You can specify the number of simultaneous build processes/deployments that should run concurrently." />
<div class="w-64"> <x-forms.input id="server.settings.dynamic_timeout" label="Deployment timeout (seconds)" required
<x-forms.checkbox helper="This will cleanup build caches / unused images / etc every 10 minutes." helper="You can define the maximum duration for a deployment to run before timing it out." />
instantSave id="server.settings.is_force_cleanup_enabled"
label="Force Cleanup Docker Engine" />
</div> </div>
@endif </div>
<div class="flex flex-wrap gap-2 sm:flex-nowrap"> <div class="flex items-center gap-2 pt-4 pb-2">
<x-forms.input id="server.settings.concurrent_builds" label="Number of concurrent builds" required <h3>Sentinel</h3>
helper="You can specify the number of simultaneous build processes/deployments that should run concurrently." /> {{-- @if ($server->isSentinelEnabled()) --}}
<x-forms.input id="server.settings.dynamic_timeout" label="Deployment timeout (seconds)" required {{-- <x-forms.button wire:click='restartSentinel'>Restart</x-forms.button> --}}
helper="You can define the maximum duration for a deployment to run before timing it out." /> {{-- @endif --}}
</div> </div>
<div class="flex items-center gap-2 pt-4 pb-2"> <div>Metrics are disabled until a few bugs are fixed.</div>
<h3>Sentinel</h3> {{-- <div class="w-64">
{{-- @if ($server->isSentinelEnabled()) --}}
{{-- <x-forms.button wire:click='restartSentinel'>Restart</x-forms.button> --}}
{{-- @endif --}}
</div>
<div>Metrics are disabled until a few bugs are fixed.</div>
{{-- <div class="w-64">
<x-forms.checkbox instantSave id="server.settings.is_metrics_enabled" label="Enable Metrics" /> <x-forms.checkbox instantSave id="server.settings.is_metrics_enabled" label="Enable Metrics" />
</div> </div>
<div class="pt-4"> <div class="pt-4">
<div class="flex flex-wrap gap-2 sm:flex-nowrap"> <div class="flex flex-wrap gap-2 sm:flex-nowrap">
<x-forms.input type="password" id="server.settings.metrics_token" label="Metrics token" required <x-forms.input type="password" id="server.settings.metrics_token" label="Metrics token" required
helper="Token for collector (Sentinel)." /> helper="Token for collector (Sentinel)." />
<x-forms.input id="server.settings.metrics_refresh_rate_seconds" label="Metrics rate (seconds)" <x-forms.input id="server.settings.metrics_refresh_rate_seconds" label="Metrics rate (seconds)"
required required
helper="The interval for gathering metrics. Lower means more disk space will be used." /> helper="The interval for gathering metrics. Lower means more disk space will be used." />
<x-forms.input id="server.settings.metrics_history_days" label="Metrics history (days)" required <x-forms.input id="server.settings.metrics_history_days" label="Metrics history (days)" required
helper="How many days should the metrics data should be reserved." /> helper="How many days should the metrics data should be reserved." />
</div> </div>
</div> --}} </div> --}}
@endif
</form> </form>
</div> </div>