mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(provider): add required field validation with toast notifications
- Add validation for provider name (required for all providers) - Add validation for API endpoint and API Key (required for non-official providers) - Use toast notifications instead of inline form errors for better visibility - Move name validation from zod schema to handleSubmit for consistent UX - Add i18n keys: endpointRequired, apiKeyRequired
This commit is contained in:
@@ -275,6 +275,8 @@
|
||||
"fillConfigContent": "Please fill in configuration content",
|
||||
"fillParameter": "Please fill in {{label}}",
|
||||
"fillTemplateValue": "Please fill in {{label}}",
|
||||
"endpointRequired": "API endpoint is required for non-official providers",
|
||||
"apiKeyRequired": "API Key is required for non-official providers",
|
||||
"configJsonError": "Config JSON format error, please check syntax",
|
||||
"authJsonRequired": "auth.json must be a JSON object",
|
||||
"authJsonError": "auth.json format error, please check JSON syntax",
|
||||
|
||||
@@ -275,6 +275,8 @@
|
||||
"fillConfigContent": "请填写配置内容",
|
||||
"fillParameter": "请填写 {{label}}",
|
||||
"fillTemplateValue": "请填写 {{label}}",
|
||||
"endpointRequired": "非官方供应商请填写 API 端点",
|
||||
"apiKeyRequired": "非官方供应商请填写 API Key",
|
||||
"configJsonError": "配置JSON格式错误,请检查语法",
|
||||
"authJsonRequired": "auth.json 必须是 JSON 对象",
|
||||
"authJsonError": "auth.json 格式错误,请检查JSON语法",
|
||||
|
||||
Reference in New Issue
Block a user