mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-27 08:01:04 +00:00
fix(accounts): expose quota credit controls for Antigravity OAuth
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
"forecastWeeklyMonthlyQuota": "Forecast weekly/monthly quota",
|
||||
"queryUnsupported": "Upstream quota queries are not supported",
|
||||
"quotaDetails": "Quota details",
|
||||
"quotaManagement": "Quota management",
|
||||
"viewDetails": "View {detailTitle} details",
|
||||
"details": "{detailTitle} details",
|
||||
"statisticalMethod": "Statistical method",
|
||||
@@ -551,7 +552,6 @@
|
||||
"weeklyThreshold": "Weekly quota remaining ≤ {percent}%",
|
||||
"minutesInAdvance": "{leadMinutes} min in advance",
|
||||
"nextUse": "Scheduled expiry use: {nextConsumeAtDisplay}",
|
||||
"limitReset": "Limit reset",
|
||||
"confirmLastReset": "Confirm last reset",
|
||||
"confirmResetAmount": "Confirm reset amount",
|
||||
"pendingAction": "View reset credits, an operation is awaiting confirmation",
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
"forecastWeeklyMonthlyQuota": "预测周/月额度",
|
||||
"queryUnsupported": "暂不支持查询上游额度",
|
||||
"quotaDetails": "额度详情",
|
||||
"quotaManagement": "额度管理",
|
||||
"viewDetails": "查看{detailTitle}详情",
|
||||
"details": "{detailTitle}详情",
|
||||
"statisticalMethod": "统计方式",
|
||||
@@ -551,7 +552,6 @@
|
||||
"weeklyThreshold": "剩余周额度 ≤ {percent}%",
|
||||
"minutesInAdvance": "提前 {leadMinutes} 分钟",
|
||||
"nextUse": "临期用卡时间 {nextConsumeAtDisplay}",
|
||||
"limitReset": "额度重置",
|
||||
"confirmLastReset": "确认上次重置",
|
||||
"confirmResetAmount": "确认重置额度",
|
||||
"pendingAction": "查看主动重置卡,有一项操作待确认",
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
"forecastWeeklyMonthlyQuota": "預測周/月額度",
|
||||
"queryUnsupported": "暫不支持查詢上游額度",
|
||||
"quotaDetails": "額度詳情",
|
||||
"quotaManagement": "額度管理",
|
||||
"viewDetails": "查看{detailTitle}詳情",
|
||||
"details": "{detailTitle}詳情",
|
||||
"statisticalMethod": "統計方式",
|
||||
@@ -551,7 +552,6 @@
|
||||
"weeklyThreshold": "剩餘週額度 ≤ {percent}%",
|
||||
"minutesInAdvance": "提前 {leadMinutes} 分鐘",
|
||||
"nextUse": "臨期用卡時間 {nextConsumeAtDisplay}",
|
||||
"limitReset": "額度重置",
|
||||
"confirmLastReset": "確認上次重置",
|
||||
"confirmResetAmount": "確認重置額度",
|
||||
"pendingAction": "查看主動重置卡,有一項操作待確認",
|
||||
|
||||
@@ -53,7 +53,7 @@ const {
|
||||
|
||||
const modalTitle = computed(() => {
|
||||
if (!confirmation.value)
|
||||
return t('accounts.quotaReset.limitReset')
|
||||
return t('accounts.quota.quotaManagement')
|
||||
return confirmation.value.ambiguous
|
||||
? t('accounts.quotaReset.confirmLastReset')
|
||||
: t('accounts.quotaReset.confirmResetAmount')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { Account } from '@/api'
|
||||
|
||||
import { ZEmpty, ZScrollbar } from '@codex-proxy/ui'
|
||||
import { ZDialog, ZEmpty, ZScrollbar } from '@codex-proxy/ui'
|
||||
|
||||
import { ChartNoAxesCombined, Link2, RefreshCw, UserRound } from '@lucide/vue'
|
||||
import { ChartNoAxesCombined, Link2, RefreshCw, TicketCheck, UserRound } from '@lucide/vue'
|
||||
|
||||
import { computed, shallowRef, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -12,6 +12,7 @@ import { formatRelativeTime } from '@/utils/relative-time'
|
||||
import { groupedAccountQuotaWindows, orderedPanelQuotaWindows } from '../../constants'
|
||||
import AccountProfileModal from '../account-profile-modal/index.vue'
|
||||
import AccountQuotaForecastModal from '../account-quota-forecast-modal/index.vue'
|
||||
import AccountQuotaCredits from './Credits.vue'
|
||||
import AccountQuotaPanelEntry from './Entry.vue'
|
||||
import QuotaActionButton from './QuotaActionButton.vue'
|
||||
import QuotaSettings from './QuotaSettings.vue'
|
||||
@@ -47,6 +48,7 @@ const quotaEntries = computed(() => {
|
||||
: windows.filter(window => !window.sourceAccountId)
|
||||
return groupedAccountQuotaWindows(orderedPanelQuotaWindows(visibleWindows))
|
||||
})
|
||||
const creditsOpen = shallowRef(false)
|
||||
const profileOpen = shallowRef(false)
|
||||
const forecastOpen = shallowRef(false)
|
||||
const hasPlanBadge = computed(() => Boolean(props.account.planType) || props.account.authenticationKind === 'api_key')
|
||||
@@ -54,7 +56,7 @@ const hasForecast = computed(() => props.account.authenticationKind !== 'api_key
|
||||
const hasPersonalInfo = computed(() => props.account.capabilities.profile || props.account.capabilities.subscription)
|
||||
const needsPeerDiscovery = computed(() => props.account.upstream?.discovered === false)
|
||||
const canRefresh = computed(() => props.account.capabilities.quotaRefresh || props.account.upstream != null)
|
||||
const hasActions = computed(() => hasPersonalInfo.value || hasForecast.value || canRefresh.value || props.account.capabilities.resetCredits)
|
||||
const hasActions = computed(() => hasPersonalInfo.value || hasForecast.value || canRefresh.value || props.account.capabilities.resetCredits || props.account.capabilities.quotaCredits)
|
||||
const lastRefreshed = computed(() => {
|
||||
const { upstream, quota } = props.account
|
||||
if (upstream?.discovered && !upstream.observedAt)
|
||||
@@ -109,6 +111,19 @@ watch(hasPersonalInfo, (available) => {
|
||||
@account-updated="emit('accountUpdated', $event)"
|
||||
@consumed="emit('quotaReset', $event)"
|
||||
/>
|
||||
<template v-else-if="account.capabilities.quotaCredits">
|
||||
<QuotaActionButton
|
||||
:label="t('accounts.quota.quotaPoints')"
|
||||
aria-haspopup="dialog"
|
||||
:aria-pressed="creditsOpen || undefined"
|
||||
@click="creditsOpen = true"
|
||||
>
|
||||
<TicketCheck class="size-3.5" />
|
||||
</QuotaActionButton>
|
||||
<ZDialog v-model="creditsOpen" :title="t('accounts.quota.quotaManagement')" width="36rem">
|
||||
<AccountQuotaCredits :key="account.id" :account="account" @account-updated="emit('accountUpdated', $event)" />
|
||||
</ZDialog>
|
||||
</template>
|
||||
<QuotaActionButton
|
||||
v-if="hasForecast"
|
||||
:label="t('accounts.quota.forecastWeeklyMonthlyQuota')"
|
||||
|
||||
Reference in New Issue
Block a user