mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
fix provider pool quota status handling
This commit is contained in:
@@ -486,14 +486,27 @@ function normalizeAuthTypeLabel(key: PoolKeyDetail | PoolKeySelectionItem): stri
|
||||
|
||||
function getStatusBadgeLabel(key: PoolKeyDetail): string | null {
|
||||
const account = getAccountStatusDisplay(key)
|
||||
if (account.blocked && account.label) return account.label
|
||||
if (account.blocked && account.label) return compactStatusBadgeLabel(account.label)
|
||||
|
||||
const oauth = getOAuthStatusDisplay(key, 0)
|
||||
if (oauth?.isInvalid) return 'Token 失效'
|
||||
if (oauth?.isExpired) return 'Token 过期'
|
||||
if (oauth?.requiresReauth) return '续期失败'
|
||||
if (oauth?.isInvalid) return '已失效'
|
||||
if (oauth?.isExpired) return '已过期'
|
||||
return null
|
||||
}
|
||||
|
||||
function compactStatusBadgeLabel(label: string): string {
|
||||
const normalized = label.trim()
|
||||
const mapped: Record<string, string> = {
|
||||
'Token 失效': '已失效',
|
||||
'Token 过期': '已过期',
|
||||
账号已封禁: '账号封禁',
|
||||
工作区已停用: '工作区停用',
|
||||
账号访问受限: '访问受限',
|
||||
}
|
||||
return Array.from(mapped[normalized] || normalized).slice(0, 5).join('')
|
||||
}
|
||||
|
||||
function getStatusBadgeTitle(key: PoolKeyDetail): string {
|
||||
const label = getStatusBadgeLabel(key)
|
||||
if (!label) return ''
|
||||
|
||||
Reference in New Issue
Block a user