Skip to content

Commit 19f2835

Browse files
dont call API when caller does not have access to it
1 parent 1c401e5 commit 19f2835

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ui/src/views/infra/UsageRecords.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,11 @@ export default {
503503
}
504504
},
505505
listUsageServerMetrics () {
506+
if (!('listUsageServerMetrics' in this.$store.getters.apis)) {
507+
this.serverMetricsLoading = false
508+
return
509+
}
510+
506511
this.serverMetricsLoading = true
507512
api('listUsageServerMetrics').then(json => {
508513
this.stats = []
@@ -639,6 +644,10 @@ export default {
639644
})
640645
},
641646
getUsageTypes () {
647+
if (!('listUsageTypes' in this.$store.getters.apis)) {
648+
return
649+
}
650+
642651
api('listUsageTypes').then(json => {
643652
if (json && json.listusagetypesresponse && json.listusagetypesresponse.usagetype) {
644653
this.usageTypes = [{ id: null, value: '' }, ...json.listusagetypesresponse.usagetype.map(x => {

0 commit comments

Comments
 (0)