fix(frontend): 状态文本国际化和错误处理修复
- AccountStatusIndicator: 状态文本使用 i18n - CreateAccountModal: TypeScript 类型修复 - TempUnschedStatusModal: 错误处理改进
This commit is contained in:
@@ -171,7 +171,7 @@ const statusText = computed(() => {
|
|||||||
if (isRateLimited.value || isOverloaded.value) {
|
if (isRateLimited.value || isOverloaded.value) {
|
||||||
return t('admin.accounts.status.limited')
|
return t('admin.accounts.status.limited')
|
||||||
}
|
}
|
||||||
return props.account.status
|
return t(`common.${props.account.status}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleTempUnschedClick = () => {
|
const handleTempUnschedClick = () => {
|
||||||
|
|||||||
@@ -2460,7 +2460,7 @@ const handleCookieAuth = async (sessionKey: string) => {
|
|||||||
const accountName = keys.length > 1 ? `${form.name} #${i + 1}` : form.name
|
const accountName = keys.length > 1 ? `${form.name} #${i + 1}` : form.name
|
||||||
|
|
||||||
// Merge interceptWarmupRequests into credentials
|
// Merge interceptWarmupRequests into credentials
|
||||||
const credentials = {
|
const credentials: Record<string, unknown> = {
|
||||||
...tokenInfo,
|
...tokenInfo,
|
||||||
...(interceptWarmupRequests.value ? { intercept_warmup_requests: true } : {})
|
...(interceptWarmupRequests.value ? { intercept_warmup_requests: true } : {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ const loadStatus = async () => {
|
|||||||
try {
|
try {
|
||||||
status.value = await adminAPI.accounts.getTempUnschedulableStatus(props.account.id)
|
status.value = await adminAPI.accounts.getTempUnschedulableStatus(props.account.id)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
appStore.showError(error.response?.data?.detail || t('admin.accounts.tempUnschedulable.failedToLoad'))
|
appStore.showError(error?.message || t('admin.accounts.tempUnschedulable.failedToLoad'))
|
||||||
status.value = null
|
status.value = null
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -230,7 +230,7 @@ const handleReset = async () => {
|
|||||||
emit('reset')
|
emit('reset')
|
||||||
handleClose()
|
handleClose()
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
appStore.showError(error.response?.data?.detail || t('admin.accounts.tempUnschedulable.resetFailed'))
|
appStore.showError(error?.message || t('admin.accounts.tempUnschedulable.resetFailed'))
|
||||||
} finally {
|
} finally {
|
||||||
resetting.value = false
|
resetting.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user