Files
HexaHost-Panel/resources/views/ip-pools/index.blade.php
2026-05-17 13:26:14 +02:00

65 lines
3.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('layouts.app')
@section('title', 'IP-Pools')
@section('heading', 'IP-Pools & Zuweisungen')
@section('content')
@if(auth()->user()->isAdmin())
<a href="{{ route('ip-pools.create') }}" class="mb-6 inline-block rounded-lg bg-cyan-600 px-4 py-2 text-sm font-medium hover:bg-cyan-500">+ Pool anlegen</a>
@endif
<div class="mb-8 grid gap-4 md:grid-cols-2">
@foreach($pools as $pool)
<div class="rounded-xl border border-slate-800 bg-slate-900/60 p-5">
<div class="flex items-start justify-between">
<div>
<h3 class="font-semibold">{{ $pool->name }}</h3>
<span class="text-xs {{ $pool->type->value === 'public' ? 'text-violet-400' : 'text-cyan-400' }}">{{ $pool->type->label() }}</span>
</div>
@if(auth()->user()->isAdmin())
<a href="{{ route('ip-pools.edit', $pool) }}" class="text-xs text-slate-400 hover:text-white">Bearbeiten</a>
@endif
</div>
<p class="mt-2 font-mono text-sm text-slate-400">{{ $pool->start_ip }} {{ $pool->end_ip }}</p>
<p class="mt-1 text-xs text-slate-500">Gateway: {{ $pool->gateway ?? '—' }} /{{ $pool->cidr }}</p>
<div class="mt-3">
<div class="flex justify-between text-xs text-slate-400 mb-1">
<span>{{ $pool->usedIpsCount() }} belegt</span>
<span>{{ $pool->freeIpsCount() }} frei</span>
</div>
<div class="h-2 rounded-full bg-slate-800">
<div class="h-full rounded-full {{ $pool->type->value === 'public' ? 'bg-violet-500' : 'bg-cyan-500' }}" style="width: {{ $pool->usage_percent }}%"></div>
</div>
</div>
</div>
@endforeach
</div>
<h2 class="mb-4 text-lg font-semibold">IP-Zuweisungen (aktive VMs)</h2>
<div class="overflow-hidden rounded-xl border border-slate-800">
<table class="w-full text-left text-sm">
<thead class="bg-slate-900 text-slate-400">
<tr>
<th class="px-4 py-3">VM</th>
@if(auth()->user()->isAdmin())<th class="px-4 py-3">Kunde</th>@endif
<th class="px-4 py-3">Private IP</th>
<th class="px-4 py-3">Public IP</th>
<th class="px-4 py-3">Pool</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-800">
@forelse($assignments as $vm)
<tr>
<td class="px-4 py-3"><a href="{{ route('vms.show', $vm) }}" class="text-cyan-400 hover:underline">{{ $vm->name }}</a></td>
@if(auth()->user()->isAdmin())<td class="px-4 py-3 text-slate-400">{{ $vm->owner?->name }}</td>@endif
<td class="px-4 py-3 font-mono">{{ $vm->ip_address ?? '—' }}</td>
<td class="px-4 py-3 font-mono text-violet-400">{{ $vm->public_ip ?? '—' }}</td>
<td class="px-4 py-3">{{ $vm->ipPool?->name ?? '—' }}</td>
</tr>
@empty
<tr><td colspan="5" class="px-4 py-8 text-center text-slate-500">Keine Zuweisungen.</td></tr>
@endforelse
</tbody>
</table>
</div>
@endsection