Private
Public Access
1
0

refactor: update components to shadcn-inspired styling and improve layout consistency

This commit is contained in:
2025-12-17 11:53:57 -05:00
parent eb015f3421
commit 71ea61a960
7 changed files with 165 additions and 169 deletions

View File

@@ -1,5 +1,5 @@
{{--
Network Address Card Component - TailServer Theme
Network Address Card Component - shadcn-inspired
For displaying IP address information with gateway, netmask, and tools
Usage:
@@ -24,116 +24,113 @@
'fromGuestAgent' => false,
])
<x-proxmox::ui.card class="mb-4">
<div class="rounded-xl border bg-card p-6 shadow-sm mb-4">
{{-- Header --}}
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-base">{{ strtoupper($type) }} Address</h3>
<h3 class="text-base font-semibold">{{ strtoupper($type) }} Address</h3>
<x-proxmox::ui.badge variant="default">
{{ $type === 'ipv6' ? 'IPv6' : 'IPv4' }}
</x-proxmox::ui.badge>
</div>
{{-- Address Grid --}}
<div class="grid md:grid-cols-3 grid-cols-1 gap-4 network-tools-grid">
<div class="grid md:grid-cols-3 gap-4">
{{-- IP Address --}}
<div class="flex flex-col gap-2 min-w-0">
<h4 class="text-sm font-semibold text-base/70">IP Address</h4>
<div class="space-y-1.5">
<span class="text-sm font-medium text-muted-foreground">IP Address</span>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-base/80">{{ $ip }}</span>
<span class="font-semibold font-mono">{{ $ip }}</span>
<x-proxmox::ui.copy-button :value="$ip" />
</div>
@if($cidr)
<p class="text-xs text-base/50 mt-1">CIDR: {{ $ip }}{{ $cidr }}</p>
<p class="text-xs text-muted-foreground">CIDR: {{ $ip }}{{ $cidr }}</p>
@endif
</div>
{{-- Gateway --}}
<div class="flex flex-col gap-2 min-w-0">
<h4 class="text-sm font-semibold text-base/70">Gateway</h4>
<div class="space-y-1.5">
<span class="text-sm font-medium text-muted-foreground">Gateway</span>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-base/80">{{ $gateway ?? 'N/A' }}</span>
<span class="font-semibold font-mono">{{ $gateway ?? 'N/A' }}</span>
@if($gateway)
<x-proxmox::ui.copy-button :value="$gateway" />
@endif
</div>
<p class="text-xs text-base/50 mt-1">
{{ $fromGuestAgent && !$gateway ? 'Not configured in database' : 'Default route for this network' }}
<p class="text-xs text-muted-foreground">
{{ $fromGuestAgent && !$gateway ? 'Not configured in database' : 'Default route' }}
</p>
</div>
{{-- Netmask --}}
<div class="flex flex-col gap-2 min-w-0">
<h4 class="text-sm font-semibold text-base/70">Subnet Mask</h4>
<div class="space-y-1.5">
<span class="text-sm font-medium text-muted-foreground">Subnet Mask</span>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-base/80">{{ $netmask ?? 'N/A' }}</span>
<span class="font-semibold font-mono">{{ $netmask ?? 'N/A' }}</span>
@if($netmask)
<x-proxmox::ui.copy-button :value="$netmask" />
@endif
</div>
<p class="text-xs text-base/50 mt-1 break-words">
{{ $fromGuestAgent && !$netmask ? 'Not configured in database' : 'Network address range mask' }}
<p class="text-xs text-muted-foreground">
{{ $fromGuestAgent && !$netmask ? 'Not configured' : 'Network range' }}
</p>
</div>
{{-- Network Tools (for public IPs) --}}
@if($isPublic)
<div class="network-tools-column flex flex-col gap-2 relative min-w-0 @if($guestInterface) network-tools-with-details @endif">
<div class="flex-1"></div>
<div class="flex gap-2 justify-end mt-auto">
@if($isIpv6)
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://ping6.ping.pe/{{ $ip }}', '_blank')"
>
Ping
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://mtr6.ping.pe/{{ $ip }}', '_blank')"
>
MTR
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://bgp.ping.pe/{{ $ip }}', '_blank')"
>
BGP
</x-proxmox::ui.button>
@else
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://ping.pe/{{ $ip }}', '_blank')"
>
Ping
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://mtr.ping.pe/{{ $ip }}', '_blank')"
>
MTR
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="primary"
size="sm"
onclick="window.open('https://bgp.ping.pe/{{ $ip }}', '_blank')"
>
BGP
</x-proxmox::ui.button>
@endif
</div>
</div>
@endif
</div>
{{-- Network Tools (for public IPs) --}}
@if($isPublic)
<div class="flex gap-2 justify-end mt-4 pt-4 border-t">
@if($isIpv6)
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://ping6.ping.pe/{{ $ip }}', '_blank')"
>
Ping
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://mtr6.ping.pe/{{ $ip }}', '_blank')"
>
MTR
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://bgp.ping.pe/{{ $ip }}', '_blank')"
>
BGP
</x-proxmox::ui.button>
@else
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://ping.pe/{{ $ip }}', '_blank')"
>
Ping
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://mtr.ping.pe/{{ $ip }}', '_blank')"
>
MTR
</x-proxmox::ui.button>
<x-proxmox::ui.button
variant="outline"
size="sm"
onclick="window.open('https://bgp.ping.pe/{{ $ip }}', '_blank')"
>
BGP
</x-proxmox::ui.button>
@endif
</div>
@endif
{{-- Guest Agent Technical Details --}}
@if($guestInterface)
<div
class="border-t border-neutral/20 pt-4 mt-4"
class="border-t pt-4 mt-4"
x-data="{ isAdvancedView: localStorage.getItem('proxmox-view-mode') === 'advanced' }"
x-init="
isAdvancedView = localStorage.getItem('proxmox-view-mode') === 'advanced';
@@ -142,50 +139,43 @@
});
"
x-show="isAdvancedView"
x-transition
x-transition:enter="transition ease-out duration-150"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
>
<h4 class="text-sm font-semibold text-base/70 mb-3">Technical Details (Guest Agent)</h4>
<div class="grid md:grid-cols-2 grid-cols-1 gap-4">
<h4 class="text-sm font-medium text-muted-foreground mb-3">Technical Details</h4>
<div class="grid md:grid-cols-2 gap-4">
@if(isset($guestInterface['hardware-address']))
<div class="flex flex-col gap-1">
<span class="text-xs font-semibold text-base/60">MAC Address</span>
<div class="space-y-1">
<span class="text-xs font-medium text-muted-foreground">MAC Address</span>
<div class="flex items-center gap-2">
<span class="text-sm font-mono text-base/80">{{ $guestInterface['hardware-address'] }}</span>
<span class="text-sm font-mono">{{ $guestInterface['hardware-address'] }}</span>
<x-proxmox::ui.copy-button :value="$guestInterface['hardware-address']" />
</div>
<p class="text-xs text-base/50 mt-1">Hardware address for this interface</p>
</div>
@endif
@if(isset($guestInterface['name']))
<div class="flex flex-col gap-1">
<span class="text-xs font-semibold text-base/60">Interface Name</span>
<span class="text-sm font-mono text-base/80">{{ $guestInterface['name'] }}</span>
<p class="text-xs text-base/50 mt-1">Network interface identifier within the guest OS</p>
<div class="space-y-1">
<span class="text-xs font-medium text-muted-foreground">Interface</span>
<span class="text-sm font-mono block">{{ $guestInterface['name'] }}</span>
</div>
@endif
@if(isset($guestInterface['statistics']))
<div class="flex flex-col gap-1">
<span class="text-xs font-semibold text-base/60">Statistics</span>
<div class="text-xs text-base/60 space-y-1">
<div class="space-y-1 md:col-span-2">
<span class="text-xs font-medium text-muted-foreground">Statistics</span>
<div class="flex flex-wrap gap-4 text-sm text-muted-foreground">
@if(isset($guestInterface['statistics']['rx-bytes']))
<div>RX: {{ number_format($guestInterface['statistics']['rx-bytes']) }} bytes</div>
<span>RX: {{ number_format($guestInterface['statistics']['rx-bytes']) }} bytes</span>
@endif
@if(isset($guestInterface['statistics']['tx-bytes']))
<div>TX: {{ number_format($guestInterface['statistics']['tx-bytes']) }} bytes</div>
@endif
@if(isset($guestInterface['statistics']['rx-packets']))
<div>RX Packets: {{ number_format($guestInterface['statistics']['rx-packets']) }}</div>
@endif
@if(isset($guestInterface['statistics']['tx-packets']))
<div>TX Packets: {{ number_format($guestInterface['statistics']['tx-packets']) }}</div>
<span>TX: {{ number_format($guestInterface['statistics']['tx-bytes']) }} bytes</span>
@endif
</div>
<p class="text-xs text-base/50 mt-1">Network traffic statistics from guest OS</p>
</div>
@endif
</div>
</div>
@endif
</x-proxmox::ui.card>
</div>