Files
Virtnet.bond/extensions/Servers/Proxmox/views/index.blade.php

54 lines
2.6 KiB
PHP

<div class="flex flex-col flex-1" style="min-height: calc(100vh - 30rem);">
<style>
@keyframes cardEntrance {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.server-card-enter {
animation: cardEntrance 0.4s ease-out both;
}
</style>
<div class="pb-6 space-y-4">
<span class="text-2xl font-bold">Servers</span>
@if(count($servers) > 1)
<div style="position: relative; width: 100%;" x-data="{ search: '' }">
<div style="position: absolute; top: 0; bottom: 0; left: 0; display: flex; align-items: center; padding-left: 14px; pointer-events: none; z-index: 1;">
<svg style="width: 16px; height: 16px; opacity: 0.5; color: inherit;" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</div>
<input type="text"
x-model="search"
@input="
document.querySelectorAll('[data-server-card]').forEach(card => {
const name = (card.dataset.serverName || '').toLowerCase();
const ip = (card.dataset.serverIp || '').toLowerCase();
const q = search.toLowerCase().trim();
card.style.display = (!q || name.includes(q) || ip.includes(q)) ? '' : 'none';
});
"
placeholder="Filter servers..."
style="width: 100%; padding: 10px 12px 10px 40px; font-size: 14px; border: 1px solid rgba(128,128,128,0.3); border-radius: 8px; background: rgba(128,128,128,0.05); outline: none; box-shadow: 0 1px 2px rgba(0,0,0,0.05);" />
</div>
@endif
</div>
<div class="flex flex-col gap-4 flex-1">
@foreach($servers as $index => $server)
<div class="server-card-enter"
style="animation-delay: {{ min($index * 80, 800) }}ms"
data-server-card
data-server-name="{{ $server->hostname ?? $server->service->product->name ?? '' }}"
data-server-ip="{{ $server->primaryIpv4->ip ?? '' }}">
<livewire:proxmox.server :server="$server" wire:key="proxmox-server-{{ $server->id }}" lazy />
</div>
@endforeach
</div>
</div>