fix(frontend): restore quota badges to capacity column and rename usage label to total

- Restore QuotaBadge (D/W/total) back to the capacity column
- Rename usage window total label from "$" to "total"
This commit is contained in:
erio
2026-03-08 21:21:28 +08:00
parent 00decae9bb
commit e603b67bdb
2 changed files with 18 additions and 1 deletions
@@ -30,6 +30,11 @@
<!-- 客户端亲和 -->
<AffinityBadge v-if="showAffinity" :account-id="account.id" :count="affinityClientCount" :base="affinityBase" :buffer="affinityBuffer" />
<!-- 配额限制 -->
<QuotaBadge v-if="showDailyQuota" label="D" :used="account.quota_daily_used ?? 0" :limit="account.quota_daily_limit!" />
<QuotaBadge v-if="showWeeklyQuota" label="W" :used="account.quota_weekly_used ?? 0" :limit="account.quota_weekly_limit!" />
<QuotaBadge v-if="showTotalQuota" :used="account.quota_used ?? 0" :limit="account.quota_limit!" />
</div>
</template>
@@ -39,6 +44,7 @@ import { useI18n } from 'vue-i18n'
import type { Account } from '@/types'
import CapacityBadge from '@/components/account/CapacityBadge.vue'
import AffinityBadge from '@/components/account/AffinityBadge.vue'
import QuotaBadge from '@/components/account/QuotaBadge.vue'
const props = defineProps<{
account: Account
@@ -195,4 +201,15 @@ const formatCost = (value: number | null | undefined) => {
if (value === null || value === undefined) return '0'
return value.toFixed(2)
}
// ====== 配额 ======
const showDailyQuota = computed(() =>
props.account.type === 'apikey' && props.account.quota_daily_limit != null && props.account.quota_daily_limit > 0
)
const showWeeklyQuota = computed(() =>
props.account.type === 'apikey' && props.account.quota_weekly_limit != null && props.account.quota_weekly_limit > 0
)
const showTotalQuota = computed(() =>
props.account.type === 'apikey' && props.account.quota_limit != null && props.account.quota_limit > 0
)
</script>
@@ -354,7 +354,7 @@
/>
<UsageProgressBar
v-if="quotaTotalBar"
label="$"
label="total"
:utilization="quotaTotalBar.utilization"
:display-value="quotaTotalBar.displayValue"
color="purple"