Skip to content

Commit c1ff9ad

Browse files
committed
resource usage in red if not available
1 parent ceeefbb commit c1ff9ad

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ui/src/views/dashboard/UsageDashboard.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
status="active"
204204
:percent="parseFloat(getPercentUsed(entity[usageType + 'total'], entity[usageType + 'limit']))"
205205
:format="p => entity[usageType + 'limit'] !== '-1' && entity[usageType + 'limit'] !== 'Unlimited' ? p.toFixed(0) + '%' : ''"
206-
stroke-color="#52c41a"
206+
:stroke-color="getStrokeColor(entity[usageType + 'available'])"
207207
size="small"
208208
/>
209209
<br/>
@@ -239,7 +239,7 @@
239239
status="active"
240240
:percent="parseFloat(getPercentUsed(entity[usageType + 'total'], entity[usageType + 'limit']))"
241241
:format="p => entity[usageType + 'limit'] !== '-1' && entity[usageType + 'limit'] !== 'Unlimited' ? p.toFixed(0) + '%' : ''"
242-
stroke-color="#52c41a"
242+
:stroke-color="getStrokeColor(entity[usageType + 'available'])"
243243
size="small"
244244
/>
245245
<br/>
@@ -275,7 +275,7 @@
275275
status="active"
276276
:percent="parseFloat(getPercentUsed(entity[usageType + 'total'], entity[usageType + 'limit']))"
277277
:format="p => entity[usageType + 'limit'] !== '-1' && entity[usageType + 'limit'] !== 'Unlimited' ? p.toFixed(0) + '%' : ''"
278-
stroke-color="#52c41a"
278+
:stroke-color="getStrokeColor(entity[usageType + 'available'])"
279279
size="small"
280280
/>
281281
<br/>
@@ -441,6 +441,9 @@ export default {
441441
}
442442
},
443443
methods: {
444+
getStrokeColor (available) {
445+
return available <= 0 ? '#ff4d4f' : '#52c41a'
446+
},
444447
fetchData () {
445448
if (store.getters.project.id) {
446449
this.listProject()

0 commit comments

Comments
 (0)