Skip to content

Commit 043cda5

Browse files
committed
removed stat card
1 parent d5158ac commit 043cda5

File tree

3 files changed

+0
-81
lines changed

3 files changed

+0
-81
lines changed

app/Livewire/PlatformStats.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
use App\Enums\ResultStatus;
66
use App\Models\Result;
7-
use App\Services\DataUsageCalculator;
8-
use Carbon\Carbon;
9-
use Cron\CronExpression;
107
use Illuminate\Support\Number;
118
use Livewire\Attributes\Computed;
129
use Livewire\Component;
@@ -19,19 +16,11 @@ public function platformStats(): array
1916
$totalResults = Result::count();
2017
$completedResults = Result::where('status', ResultStatus::Completed)->count();
2118
$failedResults = Result::where('status', ResultStatus::Failed)->count();
22-
$bandwidthLimit = null;
23-
$bandwidthUsed = DataUsageCalculator::calculate(now()->startOfMonth(), now());
2419

2520
return [
2621
'total' => Number::format($totalResults),
2722
'completed' => Number::format($completedResults),
2823
'failed' => Number::format($failedResults),
29-
'bandwidth_limit' => $bandwidthLimit,
30-
'bandwidth_used' => [
31-
'download_bytes' => $bandwidthUsed['download_bytes'],
32-
'upload_bytes' => $bandwidthUsed['upload_bytes'],
33-
'total_bytes' => $bandwidthUsed['total_bytes'],
34-
],
3524
];
3625
}
3726

app/Services/DataUsageCalculator.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

resources/views/livewire/platform-stats.blade.php

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,5 @@
2828

2929
<p class="text-xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-100">{{ $this->platformStats['failed'] }}</p>
3030
</x-filament::section>
31-
32-
<x-filament::section class="col-span-full" icon="tabler-chart-pie" icon-size="md">
33-
<x-slot name="heading">
34-
Bandwidth Quota
35-
</x-slot>
36-
37-
<x-slot name="description">
38-
Resets on {{ today()->addMonth()->startOfMonth()->format('M. jS, Y') }}
39-
</x-slot>
40-
41-
@auth
42-
<x-slot name="afterHeader">
43-
<x-filament::button
44-
href="#"
45-
tag="a"
46-
size="sm"
47-
>
48-
{{ __('general.edit') }}
49-
</x-filament::button>
50-
</x-slot>
51-
@endauth
52-
53-
<div>
54-
<div class="flex justify-between mb-1">
55-
<span class="text-sm font-medium text-body">Usage</span>
56-
<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>
57-
</div>
58-
59-
@php
60-
$used = 0;
61-
62-
if (isset($this->platformStats['bandwidth_used']['total_bytes']) && isset($this->platformStats['bandwidth_limit'])) {
63-
$used = round($this->platformStats['bandwidth_used']['total_bytes'] / (\App\Helpers\FileSize::toBytes($this->platformStats['bandwidth_limit']) ?: 1) * 100);
64-
}
65-
@endphp
66-
67-
<div class="w-full bg-zinc-200 rounded-full h-2">
68-
<div class="bg-amber-500 h-2 rounded-full" style="width: {{ min($used, 100) }}%" title="{{ number_format($used) }}%"></div>
69-
</div>
70-
</div>
71-
</x-filament::section>
7231
</div>
7332
</div>

0 commit comments

Comments
 (0)