57 lines
3.6 KiB
PHP
57 lines
3.6 KiB
PHP
<div class="space-y-5">
|
|
<div class="animate-rise">
|
|
<h1 class="text-2xl font-semibold tracking-tight text-ink">{{ __('datacenters.title') }}</h1>
|
|
<p class="mt-1 text-sm text-muted">{{ __('datacenters.subtitle') }}</p>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-5 lg:grid-cols-[1fr_320px] lg:items-start">
|
|
{{-- List --}}
|
|
<div class="overflow-hidden rounded-xl border border-line bg-surface shadow-xs animate-rise [animation-delay:60ms]">
|
|
@if ($datacenters->isEmpty())
|
|
<p class="p-8 text-center text-sm text-muted">{{ __('datacenters.empty') }}</p>
|
|
@else
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-line bg-surface-2 text-left text-xs uppercase tracking-wide text-faint">
|
|
<th class="px-4 py-3 font-semibold">{{ __('datacenters.code') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('datacenters.name') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('datacenters.hosts') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('datacenters.status') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($datacenters as $dc)
|
|
<tr class="border-b border-line last:border-0">
|
|
<td class="px-4 py-3 font-mono font-semibold text-ink">{{ $dc->code }}</td>
|
|
<td class="px-4 py-3 text-body">{{ $dc->name }}
|
|
@if ($dc->location)<span class="text-xs text-faint">· {{ $dc->location }}</span>@endif
|
|
</td>
|
|
<td class="px-4 py-3 font-mono text-xs text-muted">{{ $dc->hosts_count }}</td>
|
|
<td class="px-4 py-3">
|
|
<button type="button" wire:click="toggle('{{ $dc->uuid }}')"
|
|
class="inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-0.5 text-xs font-medium transition
|
|
{{ $dc->active ? 'border-success-border bg-success-bg text-success' : 'border-line-strong bg-surface-2 text-muted' }}">
|
|
<span class="size-1.5 rounded-pill bg-current" aria-hidden="true"></span>
|
|
{{ $dc->active ? __('datacenters.active') : __('datacenters.inactive') }}
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Add form --}}
|
|
<form wire:submit="save" class="space-y-4 rounded-xl border border-line bg-surface p-5 shadow-xs animate-rise [animation-delay:120ms]">
|
|
<h2 class="font-semibold text-ink">{{ __('datacenters.add') }}</h2>
|
|
<x-ui.input name="code" wire:model="code" :label="__('datacenters.code')" :hint="__('datacenters.code_hint')" />
|
|
<x-ui.input name="name" wire:model="name" :label="__('datacenters.name')" placeholder="Falkenstein" />
|
|
<x-ui.input name="location" wire:model="location" :label="__('datacenters.location')" :hint="__('datacenters.location_hint')" />
|
|
<x-ui.button variant="primary" type="submit" class="w-full">
|
|
<x-ui.icon name="plus" class="size-4" />{{ __('datacenters.add') }}
|
|
</x-ui.button>
|
|
</form>
|
|
</div>
|
|
</div>
|