feat(openai): 显示订阅到期时间
从 /backend-api/accounts/check 的 entitlement.expires_at 提取订阅 到期日期,每次 token 刷新时更新并存入 credentials,前端账号列表 的订阅类型和隐私下方以灰色小字显示(仅非 Free 账号)。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,10 @@
|
||||
<span>{{ privacyBadge.label }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<!-- Row 3: Subscription expiration (non-free paid accounts only) -->
|
||||
<div v-if="expiresLabel" class="text-[10px] leading-tight text-gray-400 dark:text-gray-500 pl-0.5" :title="subscriptionExpiresAt">
|
||||
{{ expiresLabel }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -62,6 +66,7 @@ interface Props {
|
||||
type: AccountType
|
||||
planType?: string
|
||||
privacyMode?: string
|
||||
subscriptionExpiresAt?: string
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
@@ -148,6 +153,22 @@ const planBadgeClass = computed(() => {
|
||||
return typeClass.value
|
||||
})
|
||||
|
||||
// Subscription expiration label (non-free only)
|
||||
const expiresLabel = computed(() => {
|
||||
if (!props.subscriptionExpiresAt || !props.planType) return ''
|
||||
if (props.planType.toLowerCase() === 'free') return ''
|
||||
try {
|
||||
const d = new Date(props.subscriptionExpiresAt)
|
||||
if (isNaN(d.getTime())) return ''
|
||||
const yyyy = d.getFullYear()
|
||||
const mm = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const dd = String(d.getDate()).padStart(2, '0')
|
||||
return `${t('admin.accounts.subscriptionExpires')} ${yyyy}-${mm}-${dd}`
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
// Privacy badge — shows different states for OpenAI/Antigravity OAuth privacy setting
|
||||
const privacyBadge = computed(() => {
|
||||
if (props.type !== 'oauth' || !props.privacyMode) return null
|
||||
|
||||
Reference in New Issue
Block a user