|
5 | 5 | {{ __('general.statistics') }} |
6 | 6 | </h2> |
7 | 7 |
|
8 | | - {{-- <x-filament::section class="col-span-full"> |
9 | | - <div class="flex items-center justify-between"> |
10 | | - <p class="text-sm/6 font-medium text-zinc-500">Quota Usage</p> |
11 | | - <a href="#" class="text-sm font-medium text-zinc-600 hover:text-amber-500 underline">Edit</a> |
12 | | - </div> |
13 | | -
|
14 | | - <div class="mt-2"> |
15 | | - <div class="flex justify-between mb-1"> |
16 | | - <span class="text-sm font-medium text-body">Bandwidth</span> |
17 | | - <span class="text-sm font-medium text-body">450MB of 1 GB</span> |
18 | | - </div> |
19 | | -
|
20 | | - <div class="w-full bg-zinc-200 rounded-full h-2"> |
21 | | - <div class="bg-amber-500 h-2 rounded-full" style="width: 45%"></div> |
22 | | - </div> |
23 | | - </div> |
24 | | - </x-filament::section> --}} |
25 | | - |
26 | 8 | @filled($this->nextSpeedtest) |
27 | 9 | <x-filament::section class="col-span-1"> |
28 | 10 | <x-slot name="heading"> |
|
64 | 46 |
|
65 | 47 | <p class="text-xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-100">{{ $this->platformStats['failed'] }}</p> |
66 | 48 | </x-filament::section> |
| 49 | + |
| 50 | + <x-filament::section class="col-span-full" icon="tabler-chart-pie" icon-size="md"> |
| 51 | + <x-slot name="heading"> |
| 52 | + Bandwidth Quota |
| 53 | + </x-slot> |
| 54 | + |
| 55 | + <x-slot name="description"> |
| 56 | + Resets on {{ today()->addMonth()->startOfMonth()->format('M. jS, Y') }} |
| 57 | + </x-slot> |
| 58 | + |
| 59 | + @auth |
| 60 | + <x-slot name="afterHeader"> |
| 61 | + <x-filament::button |
| 62 | + href="#" |
| 63 | + tag="a" |
| 64 | + size="sm" |
| 65 | + > |
| 66 | + {{ __('general.edit') }} |
| 67 | + </x-filament::button> |
| 68 | + </x-slot> |
| 69 | + @endauth |
| 70 | + |
| 71 | + <div> |
| 72 | + <div class="flex justify-between mb-1"> |
| 73 | + <span class="text-sm font-medium text-body">Usage</span> |
| 74 | + <span class="text-sm font-medium text-body">{{ Number::fileSize($this->platformStats['bandwidth_used']['total_bytes'] ?? 0, 2) }} of {{ $this->platformStats['bandwidth_limit'] ?? 'Unlimited' }}</span> |
| 75 | + </div> |
| 76 | + |
| 77 | + @php |
| 78 | + $used = 0; |
| 79 | +
|
| 80 | + if (isset($this->platformStats['bandwidth_used']['total_bytes']) && isset($this->platformStats['bandwidth_limit'])) { |
| 81 | + $used = round($this->platformStats['bandwidth_used']['total_bytes'] / (\App\Helpers\FileSize::toBytes($this->platformStats['bandwidth_limit']) ?: 1) * 100); |
| 82 | + } |
| 83 | + @endphp |
| 84 | + |
| 85 | + <div class="w-full bg-zinc-200 rounded-full h-2"> |
| 86 | + <div class="bg-amber-500 h-2 rounded-full" style="width: {{ min($used, 100) }}%" title="{{ number_format($used) }}%"></div> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </x-filament::section> |
67 | 90 | </div> |
68 | 91 | </div> |
0 commit comments