fix(portal): cloud status labels for all instance states; scale storage curve into the quota

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat/portal-design
nexxo 2026-07-25 19:16:16 +02:00
parent d05932105d
commit 32fa1028cc
4 changed files with 17 additions and 2 deletions

View File

@ -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');

View File

@ -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',

View File

@ -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',

View File

@ -9,6 +9,8 @@
'provisioning' => 'info',
'pending' => 'info',
'suspended' => 'warning',
'cancellation_scheduled' => 'warning',
'closed' => 'warning',
'warning' => 'warning',
'failed' => 'danger',
'offline' => 'danger',