File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
ui/src/components/pages/tenancy Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 44
55import enum
66from collections .abc import Mapping , Sequence
7- from dataclasses import dataclass
7+ from dataclasses import dataclass , field
88from datetime import datetime
99
1010
@@ -80,6 +80,9 @@ class Quota:
8080 used : int
8181 #: Category of quota for filtering in UI
8282 quota_type : QuotaType
83+ #: Openstack resource classes associated with the Coral credits quota which
84+ #: this quota is also controlled by
85+ related_resource_names : list = field (default_factory = list )
8386
8487
8588@dataclass (frozen = True )
Original file line number Diff line number Diff line change @@ -343,6 +343,7 @@ def quotas(self):
343343 compute_limits .total_cores ,
344344 compute_limits .total_cores_used ,
345345 dto .QuotaType .COMPUTE ,
346+ related_resource_names = ["VCPU" , "PCPU" ],
346347 ),
347348 dto .Quota (
348349 "ram" ,
@@ -351,6 +352,7 @@ def quotas(self):
351352 compute_limits .total_ram ,
352353 compute_limits .total_ram_used ,
353354 dto .QuotaType .COMPUTE ,
355+ related_resource_names = ["MEMORY_MB" ],
354356 ),
355357 dto .Quota (
356358 "machines" ,
Original file line number Diff line number Diff line change @@ -71,7 +71,16 @@ const Quotas = ({ resourceData }) => {
7171 return [ index >= 0 ? index : quotaOrdering . length , q . resource ] ;
7272 }
7373 ) ;
74+
7475 const containsCoralQuotas = sortedQuotas . some ( q => q . quota_type == "CORAL_CREDITS" )
76+
77+ // If quota is unlimited but has an associated Coral quota, hide it
78+ const resourceNames = sortedQuotas . map ( ( q ) => q . resource )
79+ sortedQuotas = sortedQuotas . filter ( ( q ) =>
80+ ! ( q . related_resource_names . some ( r => resourceNames . includes ( r ) )
81+ && q . allocated < 0 )
82+ )
83+
7584 return (
7685 // The volume service is optional, so quotas might not always be available for it
7786 < Row className = "g-3 justify-content-center" >
You can’t perform that action at this time.
0 commit comments