From 32fa1028ccd353ebfc123869dd858e045a2b5945 Mon Sep 17 00:00:00 2001 From: nexxo Date: Sat, 25 Jul 2026 19:16:16 +0200 Subject: [PATCH] fix(portal): cloud status labels for all instance states; scale storage curve into the quota Co-Authored-By: Claude Opus 4.8 --- app/Livewire/Cloud.php | 9 +++++++-- lang/de/cloud.php | 4 ++++ lang/en/cloud.php | 4 ++++ resources/views/components/ui/badge.blade.php | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Cloud.php b/app/Livewire/Cloud.php index 6da4007..b2f39f6 100644 --- a/app/Livewire/Cloud.php +++ b/app/Livewire/Cloud.php @@ -30,8 +30,13 @@ class Cloud extends Component $planKey = $shown->plan ?? 'team'; $plan = $plans[$planKey] ?? []; $quota = (int) ($shown->quota_gb ?? ($plan['quota_gb'] ?? 500)); - // Usage metering is not wired yet — show the fixture curve until it is. - $used = min($growth[count($growth) - 1], $quota); + // Usage metering is not wired yet — scale the illustrative curve into the + // instance's quota so the chart and the "x / y GB" label never disagree. + $curveMax = max($growth); + if ($curveMax > $quota) { + $growth = array_map(fn ($v) => (int) round($v / $curveMax * $quota), $growth); + } + $used = $growth[count($growth) - 1]; $domain = $shown?->custom_domain ?: ($shown?->subdomain ? $shown->subdomain.'.'.config('provisioning.dns.zone', 'clupilot.com') : 'cloud.example.com'); diff --git a/lang/de/cloud.php b/lang/de/cloud.php index 2f9a659..96d9a39 100644 --- a/lang/de/cloud.php +++ b/lang/de/cloud.php @@ -8,6 +8,10 @@ return [ 'now' => 'jetzt', 'open' => 'Cloud öffnen', 'status_active' => 'Aktiv', + 'status_provisioning' => 'Bereitstellung', + 'status_cancellation_scheduled' => 'Kündigung vorgemerkt', + 'status_failed' => 'Fehler', + 'status_suspended' => 'Ausgesetzt', 'plan' => 'Paket', 'location' => 'Serverstandort', 'version' => 'Version', diff --git a/lang/en/cloud.php b/lang/en/cloud.php index 85ea397..42ebfa1 100644 --- a/lang/en/cloud.php +++ b/lang/en/cloud.php @@ -8,6 +8,10 @@ return [ 'now' => 'now', 'open' => 'Open cloud', 'status_active' => 'Active', + 'status_provisioning' => 'Provisioning', + 'status_cancellation_scheduled' => 'Cancellation scheduled', + 'status_failed' => 'Failed', + 'status_suspended' => 'Suspended', 'plan' => 'Plan', 'location' => 'Server location', 'version' => 'Version', diff --git a/resources/views/components/ui/badge.blade.php b/resources/views/components/ui/badge.blade.php index 097dde9..821bca0 100644 --- a/resources/views/components/ui/badge.blade.php +++ b/resources/views/components/ui/badge.blade.php @@ -9,6 +9,8 @@ 'provisioning' => 'info', 'pending' => 'info', 'suspended' => 'warning', + 'cancellation_scheduled' => 'warning', + 'closed' => 'warning', 'warning' => 'warning', 'failed' => 'danger', 'offline' => 'danger',