mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-01 16:29:29 +00:00
fix(grok): fail over OAuth credential errors safely
This commit is contained in:
@@ -277,6 +277,7 @@ const billingTypeOptions = ref<SelectOption[]>([
|
||||
const errorPhaseOptions = computed<SelectOption[]>(() => [
|
||||
{ value: null, label: t('admin.usage.allTypes') },
|
||||
{ value: 'upstream', label: t('admin.ops.errorLog.typeUpstream') },
|
||||
{ value: 'account_auth', label: t('admin.ops.errorLog.typeAccountAuth') },
|
||||
{ value: 'request', label: t('admin.ops.errorLog.typeRequest') },
|
||||
{ value: 'auth', label: t('admin.ops.errorLog.typeAuth') },
|
||||
{ value: 'routing', label: t('admin.ops.errorLog.typeRouting') },
|
||||
|
||||
@@ -266,6 +266,7 @@ export default {
|
||||
typeUpstream: 'Upstream',
|
||||
typeRequest: 'Request',
|
||||
typeAuth: 'Auth',
|
||||
typeAccountAuth: 'Account Auth',
|
||||
typeRouting: 'Routing',
|
||||
typeInternal: 'Internal',
|
||||
endpoint: 'Endpoint',
|
||||
@@ -291,6 +292,7 @@ export default {
|
||||
phase: {
|
||||
request: 'Request',
|
||||
auth: 'Auth',
|
||||
account_auth: 'Account Auth',
|
||||
routing: 'Routing',
|
||||
upstream: 'Upstream',
|
||||
network: 'Network',
|
||||
|
||||
@@ -266,6 +266,7 @@ export default {
|
||||
typeUpstream: '上游',
|
||||
typeRequest: '请求',
|
||||
typeAuth: '认证',
|
||||
typeAccountAuth: '账号认证',
|
||||
typeRouting: '路由',
|
||||
typeInternal: '内部',
|
||||
endpoint: '端点',
|
||||
@@ -291,6 +292,7 @@ export default {
|
||||
phase: {
|
||||
request: '请求',
|
||||
auth: '认证',
|
||||
account_auth: '账号认证',
|
||||
routing: '路由',
|
||||
upstream: '上游',
|
||||
network: '网络',
|
||||
|
||||
@@ -9,6 +9,7 @@ export function mapErrorCategory(phase?: string | null, errType?: string | null)
|
||||
return 'auth'
|
||||
case 'routing':
|
||||
return 'service_unavailable'
|
||||
case 'account_auth':
|
||||
case 'upstream':
|
||||
case 'network':
|
||||
return 'upstream'
|
||||
|
||||
@@ -72,6 +72,7 @@ const phaseSelectOptions = computed(() => {
|
||||
{ value: '', label: t('common.all') },
|
||||
{ value: 'request', label: t('admin.ops.errorDetails.phase.request') || 'request' },
|
||||
{ value: 'auth', label: t('admin.ops.errorDetails.phase.auth') || 'auth' },
|
||||
{ value: 'account_auth', label: t('admin.ops.errorDetails.phase.account_auth') || 'account_auth' },
|
||||
{ value: 'routing', label: t('admin.ops.errorDetails.phase.routing') || 'routing' },
|
||||
{ value: 'upstream', label: t('admin.ops.errorDetails.phase.upstream') || 'upstream' },
|
||||
{ value: 'network', label: t('admin.ops.errorDetails.phase.network') || 'network' },
|
||||
|
||||
@@ -277,6 +277,9 @@ function getTypeBadge(log: OpsErrorLog): { label: string; className: string } {
|
||||
if (phase === 'auth' && owner === 'client') {
|
||||
return { label: t('admin.ops.errorLog.typeAuth'), className: 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200' }
|
||||
}
|
||||
if (phase === 'account_auth') {
|
||||
return { label: t('admin.ops.errorLog.typeAccountAuth'), className: 'bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200' }
|
||||
}
|
||||
if (phase === 'routing' && owner === 'platform') {
|
||||
return { label: t('admin.ops.errorLog.typeRouting'), className: 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user