fix: validate account status before update and update load factor hint
- Normalize non-standard status (e.g. "error") to "active" on edit load - Add pre-submit validation for status field to prevent 400 errors - Update load factor hint: "提高负载因子可以提高对账号的调度频率"
This commit is contained in:
@@ -1508,7 +1508,9 @@ watch(
|
||||
form.load_factor = newAccount.load_factor ?? null
|
||||
form.priority = newAccount.priority
|
||||
form.rate_multiplier = newAccount.rate_multiplier ?? 1
|
||||
form.status = newAccount.status as 'active' | 'inactive'
|
||||
form.status = (newAccount.status === 'active' || newAccount.status === 'inactive')
|
||||
? newAccount.status
|
||||
: 'active'
|
||||
form.group_ids = newAccount.group_ids || []
|
||||
form.expires_at = newAccount.expires_at ?? null
|
||||
|
||||
@@ -2048,6 +2050,11 @@ const handleSubmit = async () => {
|
||||
if (!props.account) return
|
||||
const accountID = props.account.id
|
||||
|
||||
if (form.status !== 'active' && form.status !== 'inactive') {
|
||||
appStore.showError(t('admin.accounts.pleaseSelectStatus'))
|
||||
return
|
||||
}
|
||||
|
||||
const updatePayload: Record<string, unknown> = { ...form }
|
||||
try {
|
||||
// 后端期望 proxy_id: 0 表示清除代理,而不是 null
|
||||
|
||||
@@ -1992,7 +1992,7 @@ export default {
|
||||
noProxy: 'No Proxy',
|
||||
concurrency: 'Concurrency',
|
||||
loadFactor: 'Load Factor',
|
||||
loadFactorHint: 'Defaults to concurrency',
|
||||
loadFactorHint: 'Higher load factor increases scheduling frequency',
|
||||
priority: 'Priority',
|
||||
priorityHint: 'Lower value accounts are used first',
|
||||
billingRateMultiplier: 'Billing Rate Multiplier',
|
||||
@@ -2012,6 +2012,7 @@ export default {
|
||||
accountUpdated: 'Account updated successfully',
|
||||
failedToCreate: 'Failed to create account',
|
||||
failedToUpdate: 'Failed to update account',
|
||||
pleaseSelectStatus: 'Please select a valid account status',
|
||||
mixedChannelWarningTitle: 'Mixed Channel Warning',
|
||||
mixedChannelWarning: 'Warning: Group "{groupName}" contains both {currentPlatform} and {otherPlatform} accounts. Mixing different channels may cause thinking block signature validation issues, which will fallback to non-thinking mode. Are you sure you want to continue?',
|
||||
pleaseEnterAccountName: 'Please enter account name',
|
||||
|
||||
@@ -2134,7 +2134,7 @@ export default {
|
||||
noProxy: '无代理',
|
||||
concurrency: '并发数',
|
||||
loadFactor: '负载因子',
|
||||
loadFactorHint: '不填则等于并发数',
|
||||
loadFactorHint: '提高负载因子可以提高对账号的调度频率',
|
||||
priority: '优先级',
|
||||
priorityHint: '优先级越小的账号优先使用',
|
||||
billingRateMultiplier: '账号计费倍率',
|
||||
@@ -2154,6 +2154,7 @@ export default {
|
||||
accountUpdated: '账号更新成功',
|
||||
failedToCreate: '创建账号失败',
|
||||
failedToUpdate: '更新账号失败',
|
||||
pleaseSelectStatus: '请选择有效的账号状态',
|
||||
mixedChannelWarningTitle: '混合渠道警告',
|
||||
mixedChannelWarning: '警告:分组 "{groupName}" 中同时包含 {currentPlatform} 和 {otherPlatform} 账号。混合使用不同渠道可能导致 thinking block 签名验证问题,会自动回退到非 thinking 模式。确定要继续吗?',
|
||||
pleaseEnterAccountName: '请输入账号名称',
|
||||
|
||||
Reference in New Issue
Block a user