mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 16:23:31 +00:00
merge main 并修复与 #5730 的语义冲突
main 侧 #5730 新增的 openai_gateway_cn_fixes_test.go 按旧 11 参签名调用 calculateOpenAIRecordUsageCost;本分支为该函数新增了第 12 个参数 pricingAt。文本无冲突但 test build 会失败,此处按本分支对同类测试 调用点的既有处理方式补传 time.Time{}。
This commit is contained in:
@@ -113,7 +113,9 @@ const formatEntry = (entry: CNProviderBalanceEntry): string => {
|
||||
|
||||
const balanceLabel = computed(() => {
|
||||
if (currentEntries.value.length === 0) {
|
||||
return t('admin.accounts.grokBalance')?.trim() || 'Balance'
|
||||
// 修复:此前误引 admin.accounts.grokBalance(实际嵌套在 usageWindow 下),
|
||||
// 未命中时渲染原始 key。CN 供应商使用自己的占位键。
|
||||
return t('admin.accounts.cnProviders.balance')
|
||||
}
|
||||
return currentEntries.value.map(formatEntry).join(' · ')
|
||||
})
|
||||
|
||||
@@ -162,6 +162,15 @@ const labelClass = computed(() => {
|
||||
if (props.platform === 'grok') {
|
||||
return `${base} bg-zinc-300/70 text-zinc-800 dark:bg-zinc-700/60 dark:text-zinc-200`
|
||||
}
|
||||
if (props.platform === 'kimi') {
|
||||
return `${base} bg-pink-200/60 text-pink-800 dark:bg-pink-800/40 dark:text-pink-300`
|
||||
}
|
||||
if (props.platform === 'zhipu') {
|
||||
return `${base} bg-indigo-200/60 text-indigo-800 dark:bg-indigo-800/40 dark:text-indigo-300`
|
||||
}
|
||||
if (props.platform === 'deepseek') {
|
||||
return `${base} bg-teal-200/60 text-teal-800 dark:bg-teal-800/40 dark:text-teal-300`
|
||||
}
|
||||
if (props.platform === 'composite') {
|
||||
return `${base} bg-cyan-200/70 text-cyan-900 dark:bg-cyan-900/50 dark:text-cyan-300`
|
||||
}
|
||||
@@ -200,6 +209,21 @@ const badgeClass = computed(() => {
|
||||
? 'bg-zinc-200 text-zinc-800 dark:bg-zinc-700 dark:text-zinc-100'
|
||||
: 'bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200'
|
||||
}
|
||||
if (props.platform === 'kimi') {
|
||||
return isSubscription.value
|
||||
? 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400'
|
||||
: 'bg-pink-50 text-pink-700 dark:bg-pink-900/20 dark:text-pink-400'
|
||||
}
|
||||
if (props.platform === 'zhipu') {
|
||||
return isSubscription.value
|
||||
? 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400'
|
||||
: 'bg-indigo-50 text-indigo-700 dark:bg-indigo-900/20 dark:text-indigo-400'
|
||||
}
|
||||
if (props.platform === 'deepseek') {
|
||||
return isSubscription.value
|
||||
? 'bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400'
|
||||
: 'bg-teal-50 text-teal-700 dark:bg-teal-900/20 dark:text-teal-400'
|
||||
}
|
||||
if (props.platform === 'composite') {
|
||||
return isSubscription.value
|
||||
? 'bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300'
|
||||
|
||||
@@ -125,6 +125,7 @@ export default {
|
||||
responses: 'Responses',
|
||||
responsesDesc: 'Provider’s native Responses endpoint — ideal for Codex.',
|
||||
},
|
||||
balance: 'Balance --',
|
||||
window5h: '5-hour window',
|
||||
windowWeekly: 'Weekly window',
|
||||
probeTooltip: 'Query the provider quota endpoint for 5-hour / weekly rolling window usage',
|
||||
|
||||
@@ -950,6 +950,9 @@ export default {
|
||||
gemini: 'Gemini',
|
||||
antigravity: 'Antigravity',
|
||||
grok: 'Grok',
|
||||
kimi: 'Kimi',
|
||||
zhipu: 'Zhipu GLM',
|
||||
deepseek: 'DeepSeek',
|
||||
composite: 'Composite',
|
||||
},
|
||||
deleteConfirm:
|
||||
|
||||
@@ -328,6 +328,7 @@ export default {
|
||||
responses: 'Responses',
|
||||
responsesDesc: '供应商原生 Responses 端点,适配 Codex。',
|
||||
},
|
||||
balance: '余额 --',
|
||||
window5h: '5 小时窗口',
|
||||
windowWeekly: '每周窗口',
|
||||
probeTooltip: '请求供应商额度端点,查询 5 小时 / 每周滚动窗口用量',
|
||||
|
||||
@@ -883,6 +883,9 @@ export default {
|
||||
gemini: 'Gemini',
|
||||
antigravity: 'Antigravity',
|
||||
grok: 'Grok',
|
||||
kimi: 'Kimi',
|
||||
zhipu: 'Zhipu GLM',
|
||||
deepseek: 'DeepSeek',
|
||||
composite: 'Composite',
|
||||
},
|
||||
saving: '保存中...',
|
||||
|
||||
@@ -146,7 +146,13 @@
|
||||
? 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400'
|
||||
: value === 'grok'
|
||||
? 'bg-zinc-200 text-zinc-800 dark:bg-zinc-700 dark:text-zinc-100'
|
||||
: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
||||
: value === 'kimi'
|
||||
? 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400'
|
||||
: value === 'zhipu'
|
||||
? 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400'
|
||||
: value === 'deepseek'
|
||||
? 'bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400'
|
||||
: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
||||
]"
|
||||
>
|
||||
<PlatformIcon :platform="value" size="xs" />
|
||||
@@ -3965,7 +3971,13 @@
|
||||
? 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400'
|
||||
: group.platform === 'grok'
|
||||
? 'bg-zinc-200 text-zinc-800 dark:bg-zinc-700 dark:text-zinc-100'
|
||||
: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
||||
: group.platform === 'kimi'
|
||||
? 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400'
|
||||
: group.platform === 'zhipu'
|
||||
? 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400'
|
||||
: group.platform === 'deepseek'
|
||||
? 'bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400'
|
||||
: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
||||
]"
|
||||
>
|
||||
{{ t("admin.groups.platforms." + group.platform) }}
|
||||
@@ -4731,6 +4743,9 @@ const platformOptions = computed(() => [
|
||||
{ value: "gemini", label: "Gemini" },
|
||||
{ value: "antigravity", label: "Antigravity" },
|
||||
{ value: "grok", label: "Grok" },
|
||||
{ value: "kimi", label: "Kimi" },
|
||||
{ value: "zhipu", label: "Zhipu GLM" },
|
||||
{ value: "deepseek", label: "DeepSeek" },
|
||||
{ value: "composite", label: "Composite" },
|
||||
]);
|
||||
|
||||
@@ -4741,6 +4756,9 @@ const platformFilterOptions = computed(() => [
|
||||
{ value: "gemini", label: "Gemini" },
|
||||
{ value: "antigravity", label: "Antigravity" },
|
||||
{ value: "grok", label: "Grok" },
|
||||
{ value: "kimi", label: "Kimi" },
|
||||
{ value: "zhipu", label: "Zhipu GLM" },
|
||||
{ value: "deepseek", label: "DeepSeek" },
|
||||
{ value: "composite", label: "Composite" },
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user