fix(frontend): 完善表单校验并添加错误提示

- UserEditModal: 添加 email 必填和 concurrency 最小值校验
- UserAttributesConfigModal: 添加 key/name 必填和 options 非空校验
- GroupsView: 添加 name 必填校验
- ProxiesView: 添加 name/host 必填和 port 范围校验
- UserBalanceModal: 添加 amount 有效性和余额充足性校验
- RedeemView: 添加空兑换码错误提示
- i18n: 添加所有新增校验的中英文翻译
This commit is contained in:
ianshaw
2026-01-04 20:22:59 -08:00
parent 960c09cdce
commit 85f53ef2dd
8 changed files with 92 additions and 6 deletions

View File

@@ -462,7 +462,8 @@ export default {
days: ' days',
codeRedeemSuccess: 'Code redeemed successfully!',
failedToRedeem: 'Failed to redeem code. Please check the code and try again.',
subscriptionRefreshFailed: 'Redeemed successfully, but failed to refresh subscription status.'
subscriptionRefreshFailed: 'Redeemed successfully, but failed to refresh subscription status.',
pleaseEnterCode: 'Please enter a redeem code'
},
// Profile
@@ -658,6 +659,10 @@ export default {
failedToDelete: 'Failed to delete user',
failedToToggle: 'Failed to update user status',
failedToLoadApiKeys: 'Failed to load user API keys',
emailRequired: 'Please enter email',
concurrencyMin: 'Concurrency must be at least 1',
amountRequired: 'Please enter a valid amount',
insufficientBalance: 'Insufficient balance',
deleteConfirm: "Are you sure you want to delete '{email}'? This action cannot be undone.",
setAllowedGroups: 'Set Allowed Groups',
allowedGroupsHint:
@@ -689,7 +694,6 @@ export default {
failedToDeposit: 'Failed to deposit',
failedToWithdraw: 'Failed to withdraw',
useDepositWithdrawButtons: 'Please use deposit/withdraw buttons to adjust balance',
insufficientBalance: 'Insufficient balance, balance cannot be negative after withdrawal',
roles: {
admin: 'Admin',
user: 'User'
@@ -749,6 +753,9 @@ export default {
failedToLoad: 'Failed to load attributes',
failedToCreate: 'Failed to create attribute',
failedToUpdate: 'Failed to update attribute',
keyRequired: 'Please enter attribute key',
nameRequired: 'Please enter display name',
optionsRequired: 'Please add at least one option',
failedToDelete: 'Failed to delete attribute',
failedToReorder: 'Failed to update order',
keyExists: 'Attribute key already exists',
@@ -816,6 +823,7 @@ export default {
failedToCreate: 'Failed to create group',
failedToUpdate: 'Failed to update group',
failedToDelete: 'Failed to delete group',
nameRequired: 'Please enter group name',
platforms: {
all: 'All Platforms',
anthropic: 'Anthropic',
@@ -1584,6 +1592,9 @@ export default {
failedToUpdate: 'Failed to update proxy',
failedToDelete: 'Failed to delete proxy',
failedToTest: 'Failed to test proxy',
nameRequired: 'Please enter proxy name',
hostRequired: 'Please enter host address',
portInvalid: 'Port must be between 1-65535',
deleteConfirm:
"Are you sure you want to delete '{name}'? Accounts using this proxy will have their proxy removed."
},