Private
Public Access
1
0
Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/notice-banner.blade.php
Joseph.Rawlings e7b33a2f6c Refactor Proxmox server views for improved UI consistency and usability
- Updated server card component to use new UI elements and improved layout.
- Enhanced status display with badges and better status indicators.
- Refined quick info row for server details with consistent styling.
- Reorganized server configuration statistics into stat cards for clarity.
- Improved help modals for statistics and storage management sections.
- Streamlined alerts and warnings for better user experience.
- Updated storage management view to utilize new UI components and improve readability.
2025-12-17 11:24:17 -05:00

99 lines
3.1 KiB
PHP

{{--
Info Notice / Alert Banner Component - TailServer Theme
Collapsible notice banners for important information
Usage:
<x-proxmox::ui.notice-banner
title="Cloud-init Configuration Notice"
variant="info"
:collapsible="true"
storage-key="overview-notice-collapsed"
>
<p>Your notice content here...</p>
</x-proxmox::ui.notice-banner>
--}}
@props([
'title' => null,
'variant' => 'info', // info, warning, danger, success
'collapsible' => false,
'storageKey' => null,
'icon' => null,
'showCondition' => null, // Alpine.js expression for conditional display
])
@php
$variants = [
'info' => [
'bg' => 'bg-info/10',
'border' => 'border-info/30',
'icon' => $icon ?? 'ri-information-line',
'iconColor' => 'text-info',
],
'warning' => [
'bg' => 'bg-warning/10',
'border' => 'border-warning/30',
'icon' => $icon ?? 'ri-alert-line',
'iconColor' => 'text-warning',
],
'danger' => [
'bg' => 'bg-danger/10',
'border' => 'border-danger/30',
'icon' => $icon ?? 'ri-error-warning-line',
'iconColor' => 'text-danger',
],
'success' => [
'bg' => 'bg-success/10',
'border' => 'border-success/30',
'icon' => $icon ?? 'ri-checkbox-circle-line',
'iconColor' => 'text-success',
],
];
$config = $variants[$variant] ?? $variants['info'];
@endphp
<div
@if($collapsible)
x-data="{
isCollapsed: {{ $storageKey ? "localStorage.getItem('$storageKey') === 'true'" : 'false' }},
toggle() {
this.isCollapsed = !this.isCollapsed;
@if($storageKey)
localStorage.setItem('{{ $storageKey }}', this.isCollapsed);
@endif
}
}"
@endif
@if($showCondition)
x-show="{{ $showCondition }}"
x-transition
@endif
{{ $attributes->class([
$config['bg'],
'border',
$config['border'],
'rounded-lg p-4',
]) }}
>
<div class="flex items-start gap-3">
<x-dynamic-component :component="$config['icon']" class="size-5 {{ $config['iconColor'] }} flex-shrink-0 mt-0.5" />
<div class="flex-1 min-w-0">
@if($title)
<div class="flex items-center justify-between mb-2">
<h3 class="text-sm font-semibold text-base">{{ $title }}</h3>
@if($collapsible)
<button @click="toggle()" type="button" class="text-base/60 hover:text-base transition-colors">
<x-ri-arrow-down-s-line x-bind:class="isCollapsed ? 'size-4 transition-transform rotate-180' : 'size-4 transition-transform'" />
</button>
@endif
</div>
@endif
<div @if($collapsible) x-show="!isCollapsed" x-transition @endif>
{{ $slot }}
</div>
</div>
</div>
</div>