CluPilotCloud/resources/views/livewire/admin/edit-datacenter.blade.php

40 lines
2.3 KiB
PHP

<div class="rounded-lg bg-surface p-6">
<div class="flex items-center justify-between">
<h3 class="text-base font-semibold text-ink">{{ __('datacenters.edit_title') }}</h3>
<span class="rounded bg-surface-2 px-2 py-0.5 font-mono text-xs text-muted">{{ $code }}</span>
</div>
<div class="mt-4 space-y-4">
<div>
<label class="text-sm font-medium text-body" for="dc-name">{{ __('datacenters.name') }}</label>
<input id="dc-name" type="text" wire:model="name" class="mt-1.5 w-full rounded-md border border-line-strong bg-surface px-3 py-2 text-sm text-ink" />
@error('name')<p class="mt-1 text-xs text-danger">{{ $message }}</p>@enderror
</div>
<div>
<label class="text-sm font-medium text-body" for="dc-location">{{ __('datacenters.location') }}</label>
<select id="dc-location" wire:model="location" class="mt-1.5 w-full rounded-md border border-line-strong bg-surface px-3 py-2 text-sm text-body">
<option value="">{{ __('datacenters.no_country') }}</option>
@if ($originalLocation !== '' && ! array_key_exists($originalLocation, $countries))
<option value="{{ $originalLocation }}">{{ $originalLocation }}</option>
@endif
@foreach ($countries as $code => $name)
<option value="{{ $code }}">{{ $name }} ({{ $code }})</option>
@endforeach
</select>
@error('location')<p class="mt-1 text-xs text-danger">{{ $message }}</p>@enderror
</div>
</div>
{{-- The one lifecycle action a location needs, and the form did not offer
it: a datacenter could be created and never switched off again. --}}
<div class="mt-5 rounded-lg border border-line bg-surface-2 p-4">
<x-ui.checkbox name="active" wire:model="active" :label="__('datacenters.active_label')" />
<p class="mt-1.5 pl-7 text-xs text-muted">{{ __('datacenters.active_hint') }}</p>
</div>
<div class="mt-6 flex justify-end gap-3">
<x-ui.button variant="secondary" x-on:click="Livewire.dispatch('closeModal')">{{ __('datacenters.cancel') }}</x-ui.button>
<x-ui.button variant="primary" wire:click="save" wire:loading.attr="disabled">{{ __('datacenters.save') }}</x-ui.button>
</div>
</div>