@@ -57,71 +57,142 @@ <h1>
57
57
</ div > <!-- /resource details -->
58
58
59
59
60
- < div ng-if ="(quotas | hashSize) === 0 ">
60
+ < div ng-if ="! (quotas | hashSize) && !(clusterQuotas | hashSize) ">
61
61
< h2 >
62
62
< span > Quota</ span >
63
63
</ h2 >
64
64
< div class ="help-block "> {{quotaHelp}}</ div >
65
- < p > < em > {{emptyMessageQuotas}}</ em > </ p >
65
+ < p > < em ng-if ="!quotas && !clusterQuotas "> Loading...</ em > < em ng-if ="quotas || clusterQuotas "> There are no resource quotas set on this project.</ em > </ p >
66
+ </ div >
67
+
68
+ < div ng-repeat ="quota in clusterQuotas | orderBy: 'metadata.name' " class ="gutter-bottom ">
69
+ < h2 >
70
+ Cluster Quota < span ng-if ="(clusterQuotas | hashSize) > 1 "> {{quota.metadata.name}}</ span >
71
+ </ h2 >
72
+ < div ng-if ="$first " class ="help-block "> Limits resource usage across a set of projects.</ div >
73
+ < dl ng-if ="quota.spec.quota.scopes.length ">
74
+ < dt > Scopes:</ dt >
75
+ < dd >
76
+ < div ng-repeat ="scope in quota.spec.quota.scopes ">
77
+ {{scope | startCase}}
78
+ < span class ="text-muted small " ng-if ="scope | scopeDetails "> — {{scope | scopeDetails}}</ span >
79
+ </ div >
80
+ </ dd >
81
+ </ dl >
82
+ < div >
83
+ < div row wrap style ="justify-content: center; ">
84
+ < div ng-if ="quota.status.total.hard.cpu " class ="mar-lg ">
85
+ < h3 class ="text-center "> CPU < small > Request</ small > </ h3 >
86
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used.cpu " total ="quota.status.total.hard.cpu " cross-project-used ="quota.status.total.used.cpu " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
87
+ </ div >
88
+ < div ng-if ="quota.status.total.hard.memory " class ="mar-lg ">
89
+ < h3 class ="text-center "> Memory < small > Request</ small > </ h3 >
90
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used.memory " cross-project-used ="quota.status.total.used.memory " total ="quota.status.total.hard.memory " type ="memory " class ="quota-chart "> </ quota-usage-chart >
91
+ </ div >
92
+ < div ng-if ="quota.status.total.hard['requests.cpu'] " class ="mar-lg ">
93
+ < h3 class ="text-center "> CPU < small > Request</ small > </ h3 >
94
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used['requests.cpu'] " cross-project-used ="quota.status.total.used['requests.cpu'] " total ="quota.status.total.hard['requests.cpu'] " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
95
+ </ div >
96
+ < div ng-if ="quota.status.total.hard['requests.memory'] " class ="mar-lg ">
97
+ < h3 class ="text-center "> Memory < small > Request</ small > </ h3 >
98
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used['requests.memory'] " cross-project-used ="quota.status.total.used['requests.memory'] " total ="quota.status.total.hard['requests.memory'] " type ="memory " class ="quota-chart "> </ quota-usage-chart >
99
+ </ div >
100
+ < div ng-if ="quota.status.total.hard['limits.cpu'] " class ="mar-lg ">
101
+ < h3 class ="text-center "> CPU < small > Limit</ small > </ h3 >
102
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used['limits.cpu'] " cross-project-used ="quota.status.total.used['limits.cpu'] " total ="quota.status.total.hard['limits.cpu'] " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
103
+ </ div >
104
+ < div ng-if ="quota.status.total.hard['limits.memory'] " class ="mar-lg ">
105
+ < h3 class ="text-center "> Memory < small > Limit</ small > </ h3 >
106
+ < quota-usage-chart height ="240 " used ="namespaceUsageByClusterQuota[quota.metadata.name].used['limits.memory'] " cross-project-used ="quota.status.total.used['limits.memory'] " total ="quota.status.total.hard['limits.memory'] " type ="memory " class ="quota-chart "> </ quota-usage-chart >
107
+ </ div >
108
+ </ div >
109
+ </ div >
110
+
111
+ < div class ="table-responsive ">
112
+ < table class ="table ">
113
+ < thead >
114
+ < th > Resource type</ th >
115
+ < th > Used (this project)</ th >
116
+ < th > Used (all projects)</ th >
117
+ < th > Max</ th >
118
+ </ thead >
119
+ < tbody >
120
+ < tr ng-if ='!quota.status.total.used ' class ="danger ">
121
+ < td colspan ="5 ">
122
+ < span data-toggle ="tooltip " title ="Missing quota status " class ="pficon pficon-error-circle-o " style ="cursor: help; "> </ span >
123
+ Status has not been reported on this quota usage record. Any resources limited by this quota record can not be allocated.
124
+ </ td >
125
+ </ tr >
126
+ <!-- Don't show quotas for type `resourcequotas`. They are frequently at limit,
127
+ which is not something to worry about, and only a cluster admin can create
128
+ those resources anyway. -->
129
+ < tr ng-repeat ="(resourceType, specMax) in quota.spec.quota.hard "
130
+ ng-if ="resourceType !== 'resourcequotas' "
131
+ ng-class ="{
132
+ warning: (quota.status.total.used[resourceType] | usageValue) >= (quota.status.total.hard[resourceType] | usageValue)
133
+ } ">
134
+ < td >
135
+ {{resourceType | humanizeQuotaResource}}
136
+ < span ng-if ="(quota.status.total.used[resourceType] | usageValue) >= (quota.status.total.hard[resourceType] | usageValue) " data-toggle ="tooltip " title ="Quota limit reached " class ="pficon pficon-warning-triangle-o " style ="cursor: help; vertical-align: middle; "> </ span >
137
+ </ td >
138
+ < td >
139
+ < span ng-if ="!namespaceUsageByClusterQuota[quota.metadata.name].used "> —</ span >
140
+ < span ng-if ="namespaceUsageByClusterQuota[quota.metadata.name].used "> {{namespaceUsageByClusterQuota[quota.metadata.name].used[resourceType] | usageWithUnits : resourceType}}</ span >
141
+ </ td >
142
+ < td >
143
+ < span ng-if ="!quota.status.total.used "> —</ span >
144
+ < span ng-if ="quota.status.total.used "> {{quota.status.total.used[resourceType] | usageWithUnits : resourceType}}</ span >
145
+ </ td >
146
+ < td >
147
+ < span ng-if ="!quota.status.total.hard "> {{specMax | usageWithUnits : resourceType}}</ span >
148
+ < span ng-if ="quota.status.total.hard "> {{quota.status.total.hard[resourceType] | usageWithUnits : resourceType}}</ span >
149
+ </ td >
150
+ </ tr >
151
+ </ tbody >
152
+ </ table >
153
+ </ div >
66
154
</ div >
67
155
68
156
< div ng-repeat ="quota in quotas | orderBy: 'metadata.name' " class ="gutter-bottom ">
69
157
< h2 >
70
- Quota < span ng-if ="(quotas | hashSize) > 1 "> {{quota.metadata.name}}</ span >
158
+ < span ng-if =" (clusterQuotas | hashSize) " > Project </ span > Quota < span ng-if ="(quotas | hashSize) > 1 "> {{quota.metadata.name}}</ span >
71
159
</ h2 >
72
160
< div ng-if ="$first " class ="help-block "> {{quotaHelp}}</ div >
73
161
< dl ng-if ="quota.spec.scopes.length ">
74
162
< dt > Scopes:</ dt >
75
163
< dd >
76
164
< div ng-repeat ="scope in quota.spec.scopes ">
77
165
{{scope | startCase}}
78
- < span class ="text-muted small ">
79
- < span ng-switch ="scope " class ="hide-ng-leave ">
80
- < span ng-switch-when ="Terminating "> — Matches pods that have an active deadline.</ span >
81
- < span ng-switch-when ="NotTerminating "> — Matches pods that do not have an active deadline.</ span >
82
- < span ng-switch-when ="BestEffort "> — Matches pods that have best effort quality of service.</ span >
83
- < span ng-switch-when ="NotBestEffort "> — Matches pods that do not have best effort quality of service.</ span >
84
- </ span >
85
- </ span >
166
+ < span class ="text-muted small " ng-if ="scope | scopeDetails "> — {{scope | scopeDetails}}</ span >
86
167
</ div >
87
168
</ dd >
88
169
</ dl >
89
170
< div >
90
- < div row wrap mobile ="column ">
91
- < div flex > </ div >
92
- < div column ng-if ="quota.status.hard.cpu " class ="center-block gutter-bottom ">
171
+ < div row wrap style ="justify-content: center; ">
172
+ < div column ng-if ="quota.status.hard.cpu " class ="mar-lg ">
93
173
< h3 class ="text-center "> CPU < small > Request</ small > </ h3 >
94
174
< quota-usage-chart used ="quota.status.used.cpu " total ="quota.status.hard.cpu " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
95
175
</ div >
96
- < div column ng-if ="quota.status.hard.memory " class ="center-block gutter-bottom ">
176
+ < div column ng-if ="quota.status.hard.memory " class ="mar-lg ">
97
177
< h3 class ="text-center "> Memory < small > Request</ small > </ h3 >
98
178
< quota-usage-chart used ="quota.status.used.memory " total ="quota.status.hard.memory " type ="memory " class ="quota-chart "> </ quota-usage-chart >
99
179
</ div >
100
- < div flex > </ div >
101
- </ div >
102
- < div row wrap mobile ="column ">
103
- < div flex > </ div >
104
- < div column ng-if ="quota.status.hard['requests.cpu'] " class ="center-block gutter-bottom ">
180
+ < div column ng-if ="quota.status.hard['requests.cpu'] " class ="mar-lg ">
105
181
< h3 class ="text-center "> CPU < small > Request</ small > </ h3 >
106
182
< quota-usage-chart used ="quota.status.used['requests.cpu'] " total ="quota.status.hard['requests.cpu'] " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
107
183
</ div >
108
- < div column ng-if ="quota.status.hard['requests.memory'] " class ="center-block gutter-bottom ">
184
+ < div column ng-if ="quota.status.hard['requests.memory'] " class ="mar-lg ">
109
185
< h3 class ="text-center "> Memory < small > Request</ small > </ h3 >
110
186
< quota-usage-chart used ="quota.status.used['requests.memory'] " total ="quota.status.hard['requests.memory'] " type ="memory " class ="quota-chart "> </ quota-usage-chart >
111
187
</ div >
112
- < div flex > </ div >
113
- </ div >
114
- < div row wrap mobile ="column ">
115
- < div flex > </ div >
116
- < div column ng-if ="quota.status.hard['limits.cpu'] " class ="center-block gutter-bottom ">
188
+ < div ng-if ="quota.status.hard['limits.cpu'] " class ="mar-lg ">
117
189
< h3 class ="text-center "> CPU < small > Limit</ small > </ h3 >
118
190
< quota-usage-chart used ="quota.status.used['limits.cpu'] " total ="quota.status.hard['limits.cpu'] " type ="cpu " class ="quota-chart "> </ quota-usage-chart >
119
191
</ div >
120
- < div column ng-if ="quota.status.hard['limits.memory'] " class ="center-block gutter-bottom ">
192
+ < div ng-if ="quota.status.hard['limits.memory'] " class ="mar-lg ">
121
193
< h3 class ="text-center "> Memory < small > Limit</ small > </ h3 >
122
194
< quota-usage-chart used ="quota.status.used['limits.memory'] " total ="quota.status.hard['limits.memory'] " type ="memory " class ="quota-chart "> </ quota-usage-chart >
123
195
</ div >
124
- < div flex > </ div >
125
196
</ div >
126
197
</ div >
127
198
0 commit comments