- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
71 lines
2.8 KiB
PHP
71 lines
2.8 KiB
PHP
{{--
|
|
Resource Allocation Card Component - shadcn-style
|
|
For displaying CPU, Memory, and other resource allocation vs entitlement
|
|
|
|
Usage:
|
|
<x-proxmox::ui.allocation-card
|
|
label="CPU Allocation"
|
|
:percent="45"
|
|
usage-summary="1.8 / 4 vCPU"
|
|
entitlement-label="4 vCPU entitlement"
|
|
description="Live hypervisor usage sampled directly from the cluster."
|
|
gradient="linear-gradient(90deg, #38bdf8 0%, #6366f1 100%)"
|
|
:badge="['label' => 'Healthy', 'class' => 'text-success bg-success/15']"
|
|
/>
|
|
--}}
|
|
|
|
@props([
|
|
'label',
|
|
'percent' => null,
|
|
'usageSummary',
|
|
'entitlementLabel',
|
|
'description' => null,
|
|
'gradient' => 'linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%)',
|
|
'badge' => null,
|
|
'icon' => null,
|
|
'iconColor' => 'text-primary',
|
|
])
|
|
|
|
<div {{ $attributes->class(['rounded-xl border bg-card p-4 shadow-sm transition-colors duration-150 hover:bg-accent/50']) }}>
|
|
<div class="flex flex-col gap-3">
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="flex items-start gap-3">
|
|
@if($icon)
|
|
<div class="flex-shrink-0 size-9 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
<x-dynamic-component :component="$icon" class="size-4 {{ $iconColor }}" />
|
|
</div>
|
|
@endif
|
|
<div class="min-w-0 space-y-0.5">
|
|
<p class="text-xs font-medium text-muted-foreground">{{ $label }}</p>
|
|
<p class="text-xl font-bold tracking-tight">{{ $usageSummary }}</p>
|
|
<p class="text-xs text-muted-foreground">{{ $entitlementLabel }}</p>
|
|
</div>
|
|
</div>
|
|
@if($badge)
|
|
<span class="flex-shrink-0 text-xs font-medium px-2 py-0.5 rounded-full {{ $badge['class'] ?? 'text-muted-foreground bg-muted' }}">
|
|
{{ $badge['label'] ?? '' }}
|
|
</span>
|
|
@endif
|
|
</div>
|
|
|
|
@if(!is_null($percent))
|
|
<div class="space-y-1.5">
|
|
<div class="flex items-center justify-between text-xs">
|
|
<span class="text-muted-foreground">Usage</span>
|
|
<span class="font-medium">{{ $percent }}%</span>
|
|
</div>
|
|
<div class="h-1.5 rounded-full bg-muted overflow-hidden">
|
|
<div
|
|
class="h-full rounded-full transition-all duration-300"
|
|
style="width: {{ min($percent, 130) }}%; background-image: {{ $gradient }};"
|
|
></div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@if($description)
|
|
<p class="text-xs text-muted-foreground/70">{{ $description }}</p>
|
|
@endif
|
|
</div>
|
|
</div>
|