Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/components/view/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
:rowSelection="explicitlyAllowRowSelection || enableGroupAction() || $route.name === 'event' ? {selectedRowKeys: selectedRowKeys, onChange: onSelectChange, columnWidth: 30} : null"
:rowClassName="getRowClassName"
@resizeColumn="handleResizeColumn"
style="overflow-y: auto"
:style="{ 'overflow-y': this.$route.name === 'usage' ? 'hidden' : 'auto' }"
>
<template #customFilterDropdown>
<div style="padding: 8px" class="filter-dropdown">
Expand Down
17 changes: 14 additions & 3 deletions ui/src/views/infra/UsageRecords.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<a-row justify="end">
<a-col>
<tooltip-button
v-if="'generateUsageRecords' in this.$store.getters.apis"
type="primary"
icon="hdd-outlined"
:tooltip="$t('label.usage.records.generate')"
Expand All @@ -58,6 +59,7 @@
</a-col>&nbsp;&nbsp;
<a-col>
<tooltip-button
v-if="'removeRawUsageRecords' in this.$store.getters.apis"
type="danger"
icon="delete-outlined"
:tooltip="$t('label.usage.records.purge')"
Expand All @@ -70,7 +72,7 @@
</a-card>
</a-affix>
<a-col>
<a-card size="small" :loading="serverMetricsLoading">
<a-card size="small" :loading="serverMetricsLoading" v-if="'listUsageServerMetrics' in this.$store.getters.apis">
<a-row justify="space-around">
<a-card-grid style="width: 30%; text-align: center; font-size: small;">
<a-statistic
Expand Down Expand Up @@ -159,7 +161,7 @@
/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-col :span="3" v-if="'listUsageTypes' in this.$store.getters.apis">
<a-form-item
ref="type"
name="type"
Expand All @@ -173,7 +175,7 @@
/>
</a-form-item>
</a-col>
<a-col :span="3">
<a-col :span="3" v-if="'listUsageTypes' in this.$store.getters.apis">
<a-form-item
ref="id"
name="id"
Expand Down Expand Up @@ -501,6 +503,11 @@ export default {
}
},
listUsageServerMetrics () {
if (!('listUsageServerMetrics' in this.$store.getters.apis)) {
this.serverMetricsLoading = false
return
}

this.serverMetricsLoading = true
api('listUsageServerMetrics').then(json => {
this.stats = []
Expand Down Expand Up @@ -637,6 +644,10 @@ export default {
})
},
getUsageTypes () {
if (!('listUsageTypes' in this.$store.getters.apis)) {
return
}

api('listUsageTypes').then(json => {
if (json && json.listusagetypesresponse && json.listusagetypesresponse.usagetype) {
this.usageTypes = [{ id: null, value: '' }, ...json.listusagetypesresponse.usagetype.map(x => {
Expand Down