feat(antigravity): 从 LoadCodeAssist 复用 TierInfo 提取 plan_type

复用已有 GetTier() 返回的 tier ID(free-tier / g1-pro-tier /
g1-ultra-tier),通过 TierIDToPlanType 映射为 Free / Pro / Ultra,
在 loadProjectIDWithRetry 中顺带提取并写入 credentials.plan_type;
前端增加 Abnormal 异常套餐红色标记。

Made-with: Cursor
This commit is contained in:
QTom
2026-03-25 17:28:42 +08:00
parent c2965c0fb0
commit f6fd7c83e3
8 changed files with 216 additions and 28 deletions

View File

@@ -31,7 +31,7 @@
</div>
<!-- Row 2: Plan type + Privacy mode (only if either exists) -->
<div v-if="planLabel || privacyBadge" class="inline-flex items-center overflow-hidden rounded-md">
<span v-if="planLabel" :class="['inline-flex items-center gap-1 px-1.5 py-1', typeClass]">
<span v-if="planLabel" :class="['inline-flex items-center gap-1 px-1.5 py-1', planBadgeClass]">
<span>{{ planLabel }}</span>
</span>
<span
@@ -102,6 +102,8 @@ const planLabel = computed(() => {
return 'Pro'
case 'free':
return 'Free'
case 'abnormal':
return t('admin.accounts.subscriptionAbnormal')
default:
return props.planType
}
@@ -139,6 +141,13 @@ const typeClass = computed(() => {
return 'bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400'
})
const planBadgeClass = computed(() => {
if (props.planType && props.planType.toLowerCase() === 'abnormal') {
return 'bg-red-100 text-red-600 dark:bg-red-900/30 dark:text-red-400'
}
return typeClass.value
})
// Privacy badge — shows different states for OpenAI/Antigravity OAuth privacy setting
const privacyBadge = computed(() => {
if (props.type !== 'oauth' || !props.privacyMode) return null