fix: update storage quota checks to use 'meets or exceeds' logic for better clarity

This commit is contained in:
2025-12-05 06:31:54 -05:00
parent 0ba669340e
commit 2a07fe78fc
2 changed files with 7 additions and 7 deletions

View File

@@ -1084,9 +1084,9 @@ class Storage extends Component
}
// The drive being reattached is already counted in totalAllocatedStorage (which includes unused drives)
// So we just need to check if the total exceeds the max
if ($this->totalAllocatedStorage > $this->maxAllowedStorage && $this->maxAllowedStorage > 0) {
$this->notify('Storage quota exceeded. Total storage (' . number_format($this->totalAllocatedStorage, 1) . ' GB) exceeds your plan allocation (' . number_format($this->maxAllowedStorage, 1) . ' GB). Please upgrade your service or delete drives to allow this configuration.', 'error');
// So we just need to check if the total meets or exceeds the max
if ($this->totalAllocatedStorage >= $this->maxAllowedStorage && $this->maxAllowedStorage > 0) {
$this->notify('Storage quota reached. Total storage (' . number_format($this->totalAllocatedStorage, 1) . ' GB) meets or exceeds your plan allocation (' . number_format($this->maxAllowedStorage, 1) . ' GB). Please upgrade your service or delete drives to allow this configuration.', 'error');
return;
}

View File

@@ -336,11 +336,11 @@
</p>
</div>
@endif
@if($totalAllocatedStorage > $maxAllowedStorage && $maxAllowedStorage > 0)
@if($totalAllocatedStorage >= $maxAllowedStorage && $maxAllowedStorage > 0)
<div class="mt-3 p-3 rounded-lg bg-danger/10 border border-danger/30">
<p class="text-xs text-danger flex items-center gap-2">
<x-ri-error-warning-line class="size-4 flex-shrink-0" />
Storage quota exceeded ({{ number_format($totalAllocatedStorage, 1) }} GB / {{ number_format($maxAllowedStorage, 1) }} GB). Reattaching drives is disabled. Please upgrade your service or delete drives to allow this configuration.
Storage quota reached ({{ number_format($totalAllocatedStorage, 1) }} GB / {{ number_format($maxAllowedStorage, 1) }} GB). Reattaching drives is disabled. Please upgrade your service or delete drives to allow this configuration.
</p>
</div>
@endif
@@ -372,9 +372,9 @@
</div>
<div class="flex items-center gap-2 flex-shrink-0">
@if($totalAllocatedStorage > $maxAllowedStorage && $maxAllowedStorage > 0)
@if($totalAllocatedStorage >= $maxAllowedStorage && $maxAllowedStorage > 0)
<button disabled
title="Storage quota exceeded - please upgrade your service or delete drives"
title="Storage quota reached - please upgrade your service or delete drives"
style="display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 500; border-radius: 0.5rem; border: 1px solid rgb(150 150 150 / 0.3); background-color: rgb(150 150 150 / 0.1); color: rgb(150 150 150); cursor: not-allowed; opacity: 0.6;">
<x-ri-link class="size-3.5" />
Reattach