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
parent
d05932105d
commit
32fa1028cc
|
|
@ -30,8 +30,13 @@ class Cloud extends Component
|
||||||
$planKey = $shown->plan ?? 'team';
|
$planKey = $shown->plan ?? 'team';
|
||||||
$plan = $plans[$planKey] ?? [];
|
$plan = $plans[$planKey] ?? [];
|
||||||
$quota = (int) ($shown->quota_gb ?? ($plan['quota_gb'] ?? 500));
|
$quota = (int) ($shown->quota_gb ?? ($plan['quota_gb'] ?? 500));
|
||||||
// Usage metering is not wired yet — show the fixture curve until it is.
|
// Usage metering is not wired yet — scale the illustrative curve into the
|
||||||
$used = min($growth[count($growth) - 1], $quota);
|
// 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
|
$domain = $shown?->custom_domain
|
||||||
?: ($shown?->subdomain ? $shown->subdomain.'.'.config('provisioning.dns.zone', 'clupilot.com') : 'cloud.example.com');
|
?: ($shown?->subdomain ? $shown->subdomain.'.'.config('provisioning.dns.zone', 'clupilot.com') : 'cloud.example.com');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ return [
|
||||||
'now' => 'jetzt',
|
'now' => 'jetzt',
|
||||||
'open' => 'Cloud öffnen',
|
'open' => 'Cloud öffnen',
|
||||||
'status_active' => 'Aktiv',
|
'status_active' => 'Aktiv',
|
||||||
|
'status_provisioning' => 'Bereitstellung',
|
||||||
|
'status_cancellation_scheduled' => 'Kündigung vorgemerkt',
|
||||||
|
'status_failed' => 'Fehler',
|
||||||
|
'status_suspended' => 'Ausgesetzt',
|
||||||
'plan' => 'Paket',
|
'plan' => 'Paket',
|
||||||
'location' => 'Serverstandort',
|
'location' => 'Serverstandort',
|
||||||
'version' => 'Version',
|
'version' => 'Version',
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ return [
|
||||||
'now' => 'now',
|
'now' => 'now',
|
||||||
'open' => 'Open cloud',
|
'open' => 'Open cloud',
|
||||||
'status_active' => 'Active',
|
'status_active' => 'Active',
|
||||||
|
'status_provisioning' => 'Provisioning',
|
||||||
|
'status_cancellation_scheduled' => 'Cancellation scheduled',
|
||||||
|
'status_failed' => 'Failed',
|
||||||
|
'status_suspended' => 'Suspended',
|
||||||
'plan' => 'Plan',
|
'plan' => 'Plan',
|
||||||
'location' => 'Server location',
|
'location' => 'Server location',
|
||||||
'version' => 'Version',
|
'version' => 'Version',
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
'provisioning' => 'info',
|
'provisioning' => 'info',
|
||||||
'pending' => 'info',
|
'pending' => 'info',
|
||||||
'suspended' => 'warning',
|
'suspended' => 'warning',
|
||||||
|
'cancellation_scheduled' => 'warning',
|
||||||
|
'closed' => 'warning',
|
||||||
'warning' => 'warning',
|
'warning' => 'warning',
|
||||||
'failed' => 'danger',
|
'failed' => 'danger',
|
||||||
'offline' => 'danger',
|
'offline' => 'danger',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue