Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/progress.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

76 lines
2.3 KiB
PHP

{{--
Progress Bar Component - AdminLTE Theme
Based on AdminLTE v4 Progress Bar styling patterns
Usage:
<x-proxmox::ui.progress :value="75" />
<x-proxmox::ui.progress :value="90" color="danger" showLabel />
<x-proxmox::ui.progress :value="60" color="auto" />
--}}
@props([
'value' => 0,
'max' => 100,
'color' => 'primary',
'size' => 'md',
'showLabel' => false,
'label' => null,
'gradient' => null,
'animated' => false,
'striped' => false,
])
@php
$percent = $max > 0 ? min(100, ($value / $max) * 100) : 0;
$colorClasses = [
'primary' => 'lte-bg-primary',
'secondary' => 'lte-bg-secondary',
'success' => 'lte-bg-success',
'warning' => 'lte-bg-warning',
'danger' => 'lte-bg-danger',
'info' => 'lte-bg-info',
];
$sizeClasses = [
'xs' => 'lte-progress-xs',
'sm' => 'lte-progress-sm',
'md' => '',
'lg' => '',
'xl' => '',
];
$colorClass = $colorClasses[$color] ?? $colorClasses['primary'];
$sizeClass = $sizeClasses[$size] ?? '';
// Auto-select color based on value if specified
if ($color === 'auto') {
if ($percent >= 90) {
$colorClass = $colorClasses['danger'];
} elseif ($percent >= 70) {
$colorClass = $colorClasses['warning'];
} else {
$colorClass = $colorClasses['success'];
}
}
@endphp
<div {{ $attributes->class(['w-full']) }}>
@if($showLabel || $label)
<div class="mb-2 flex items-center justify-between" style="font-size: 0.875rem;">
<span style="font-weight: 500;">{{ $label ?? 'Usage' }}</span>
<span style="font-weight: 600;">{{ number_format($percent, 1) }}%</span>
</div>
@endif
<div class="lte-progress {{ $sizeClass }}">
<div
class="lte-progress-bar {{ $colorClass }} {{ $striped ? 'lte-progress-bar-striped' : '' }} {{ $animated ? 'lte-progress-bar-animated' : '' }}"
role="progressbar"
style="width: {{ $percent }}%; {{ $gradient ? 'background-image: ' . $gradient . ';' : '' }}"
aria-valuenow="{{ $percent }}"
aria-valuemin="0"
aria-valuemax="100"
></div>
</div>
</div>