- 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.
56 lines
1.9 KiB
PHP
56 lines
1.9 KiB
PHP
@props([
|
|
'label' => null,
|
|
'value' => null,
|
|
'icon' => null,
|
|
'iconClass' => 'size-4',
|
|
'mono' => false,
|
|
'copyable' => false,
|
|
'truncate' => false,
|
|
'href' => null,
|
|
'vertical' => false,
|
|
])
|
|
|
|
@php
|
|
$valueClasses = 'text-base/90';
|
|
if ($mono) $valueClasses .= ' font-mono text-sm';
|
|
if ($truncate) $valueClasses .= ' truncate';
|
|
@endphp
|
|
|
|
<div {{ $attributes->merge(['class' => $vertical ? 'flex flex-col gap-1' : 'flex items-center justify-between gap-4 py-2']) }}>
|
|
{{-- Label --}}
|
|
<div class="flex items-center gap-2 text-sm text-base/60 {{ $vertical ? '' : 'flex-shrink-0' }}">
|
|
@if($icon)
|
|
<x-dynamic-component :component="$icon" class="{{ $iconClass }}" />
|
|
@endif
|
|
<span>{{ $label }}</span>
|
|
</div>
|
|
|
|
{{-- Value --}}
|
|
<div class="flex items-center gap-2 {{ $valueClasses }} {{ $vertical ? '' : 'text-right min-w-0' }}">
|
|
@if($href)
|
|
<a href="{{ $href }}" class="text-primary hover:underline truncate">
|
|
{{ $value ?? $slot }}
|
|
</a>
|
|
@else
|
|
<span class="{{ $truncate ? 'truncate' : '' }}">{{ $value ?? $slot }}</span>
|
|
@endif
|
|
|
|
@if($copyable && ($value || $slot->isNotEmpty()))
|
|
<button
|
|
type="button"
|
|
x-data="{ copied: false }"
|
|
@click="
|
|
navigator.clipboard.writeText('{{ addslashes($value ?? $slot->toHtml()) }}');
|
|
copied = true;
|
|
setTimeout(() => copied = false, 2000);
|
|
"
|
|
class="text-base/50 hover:text-base/70 transition-colors flex-shrink-0"
|
|
:title="copied ? 'Copied!' : 'Copy to clipboard'"
|
|
>
|
|
<x-ri-file-copy-line x-show="!copied" class="size-4" />
|
|
<x-ri-check-line x-show="copied" x-cloak class="size-4 text-success" />
|
|
</button>
|
|
@endif
|
|
</div>
|
|
</div>
|