Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/network-address-card.blade.php
Joseph.Rawlings 760cf84451 Add AdminLTE-style CSS framework to app.css
- Introduced AdminLTE CSS variables for color palette, body colors, card styles, and button styles.
- Implemented card components with variants for primary, success, warning, danger, and info.
- Added button styles including sizes and outline variants.
- Created form controls, select inputs, and input groups with consistent styling.
- Included utility classes for text and background colors, gradients, and shadows.
- Developed components for badges, alerts, callouts, progress bars, tables, small boxes, and info boxes.
- Integrated modal, dropdown, spinner, tooltip, and direct chat styles.
- Established timeline and close button styles, with dark mode support for specific components.
2025-12-17 13:45:56 -05:00

182 lines
8.1 KiB
PHP

{{--
Network Address Card Component - AdminLTE style
For displaying IP address information with gateway, netmask, and tools
Usage:
<x-proxmox::ui.network-address-card
:network="$network"
:cidr="$cidr"
:is-public="$isPublic"
:is-ipv6="$isIpv6"
:guest-interface="$guestInterface"
/>
--}}
@props([
'type' => 'ipv4',
'ip',
'gateway' => null,
'netmask' => null,
'cidr' => null,
'isPublic' => false,
'isIpv6' => false,
'guestInterface' => null,
'fromGuestAgent' => false,
])
<div class="card-lte mb-4" style="background: #fff; border-radius: .375rem; box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2); padding: 1.5rem;">
{{-- Header --}}
<div style="margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between;">
<h3 style="font-size: 1.125rem; font-weight: 600; color: #212529; margin: 0;">{{ strtoupper($type) }} Address</h3>
<x-proxmox::ui.badge variant="default">
{{ $type === 'ipv6' ? 'IPv6' : 'IPv4' }}
</x-proxmox::ui.badge>
</div>
{{-- Address Grid --}}
<div class="grid gap-5 md:grid-cols-3">
{{-- IP Address --}}
<div style="display: flex; flex-direction: column; gap: .5rem;">
<span style="font-size: .875rem; font-weight: 500; color: #6c757d;">IP Address</span>
<div class="flex items-center gap-2.5">
<span style="font-family: ui-monospace, monospace; font-weight: 600; color: #212529;">{{ $ip }}</span>
<x-proxmox::ui.copy-button :value="$ip" />
</div>
@if($cidr)
<p style="font-size: .75rem; color: #6c757d; margin: 0;">CIDR: {{ $ip }}{{ $cidr }}</p>
@endif
</div>
{{-- Gateway --}}
<div style="display: flex; flex-direction: column; gap: .5rem;">
<span style="font-size: .875rem; font-weight: 500; color: #6c757d;">Gateway</span>
<div class="flex items-center gap-2.5">
<span style="font-family: ui-monospace, monospace; font-weight: 600; color: #212529;">{{ $gateway ?? 'N/A' }}</span>
@if($gateway)
<x-proxmox::ui.copy-button :value="$gateway" />
@endif
</div>
<p style="font-size: .75rem; color: #6c757d; margin: 0;">
{{ $fromGuestAgent && !$gateway ? 'Not configured in database' : 'Default route' }}
</p>
</div>
{{-- Netmask --}}
<div style="display: flex; flex-direction: column; gap: .5rem;">
<span style="font-size: .875rem; font-weight: 500; color: #6c757d;">Subnet Mask</span>
<div class="flex items-center gap-2.5">
<span style="font-family: ui-monospace, monospace; font-weight: 600; color: #212529;">{{ $netmask ?? 'N/A' }}</span>
@if($netmask)
<x-proxmox::ui.copy-button :value="$netmask" />
@endif
</div>
<p style="font-size: .75rem; color: #6c757d; margin: 0;">
{{ $fromGuestAgent && !$netmask ? 'Not configured' : 'Network range' }}
</p>
</div>
</div>
{{-- Network Tools (for public IPs) --}}
@if($isPublic)
<div style="margin-top: 1.25rem; display: flex; justify-content: flex-end; gap: .75rem; border-top: 1px solid #dee2e6; padding-top: 1.25rem;">
@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
style="margin-top: 1.25rem; border-top: 1px solid #dee2e6; padding-top: 1.25rem;"
x-data="{ isAdvancedView: localStorage.getItem('proxmox-view-mode') === 'advanced' }"
x-init="
isAdvancedView = localStorage.getItem('proxmox-view-mode') === 'advanced';
window.addEventListener('proxmox-view-mode-changed', (e) => {
isAdvancedView = e.detail.isAdvancedView;
});
"
x-show="isAdvancedView"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
>
<h4 style="margin-bottom: 1rem; font-size: .875rem; font-weight: 500; color: #6c757d;">Technical Details</h4>
<div class="grid gap-4 md:grid-cols-2">
@if(isset($guestInterface['hardware-address']))
<div style="display: flex; flex-direction: column; gap: .375rem;">
<span style="font-size: .75rem; font-weight: 500; color: #6c757d;">MAC Address</span>
<div class="flex items-center gap-2.5">
<span style="font-family: ui-monospace, monospace; font-size: .875rem; color: #495057;">{{ $guestInterface['hardware-address'] }}</span>
<x-proxmox::ui.copy-button :value="$guestInterface['hardware-address']" />
</div>
</div>
@endif
@if(isset($guestInterface['name']))
<div style="display: flex; flex-direction: column; gap: .375rem;">
<span style="font-size: .75rem; font-weight: 500; color: #6c757d;">Interface</span>
<span style="font-family: ui-monospace, monospace; font-size: .875rem; color: #495057; display: block;">{{ $guestInterface['name'] }}</span>
</div>
@endif
@if(isset($guestInterface['statistics']))
<div class="md:col-span-2" style="display: flex; flex-direction: column; gap: .375rem;">
<span style="font-size: .75rem; font-weight: 500; color: #6c757d;">Statistics</span>
<div class="flex flex-wrap gap-4" style="font-size: .875rem; color: #495057;">
@if(isset($guestInterface['statistics']['rx-bytes']))
<span>RX: {{ number_format($guestInterface['statistics']['rx-bytes']) }} bytes</span>
@endif
@if(isset($guestInterface['statistics']['tx-bytes']))
<span>TX: {{ number_format($guestInterface['statistics']['tx-bytes']) }} bytes</span>
@endif
</div>
</div>
@endif
</div>
</div>
@endif
</div>