wake words aupdated

This commit is contained in:
rahulpscraftech360 2025-08-23 18:54:13 +05:30
parent 4cfe44be01
commit 8b44a9ab25
19 changed files with 806 additions and 135 deletions

View file

@ -0,0 +1,7 @@
-- Translate Chinese dictionary type names to English
UPDATE `sys_dict_type` SET `dict_name` = 'Mobile Area' WHERE `dict_type` = 'MOBILE_AREA';
UPDATE `sys_dict_type` SET `dict_name` = 'Firmware Type' WHERE `dict_type` = 'FIRMWARE_TYPE';
-- Also update remarks to English
UPDATE `sys_dict_type` SET `remark` = 'Mobile area codes dictionary' WHERE `dict_type` = 'MOBILE_AREA';
UPDATE `sys_dict_type` SET `remark` = 'Firmware types dictionary' WHERE `dict_type` = 'FIRMWARE_TYPE';

View file

@ -0,0 +1,401 @@
-- Translate provider field labels from Chinese to English
-- This will update the field labels shown in the Call Information section
-- Update common field labels across all providers
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"API密钥"', '"label":"API Key"')
WHERE fields LIKE '%"label":"API密钥"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"服务地址"', '"label":"Service URL"')
WHERE fields LIKE '%"label":"服务地址"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"基础URL"', '"label":"Base URL"')
WHERE fields LIKE '%"label":"基础URL"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"模型名称"', '"label":"Model Name"')
WHERE fields LIKE '%"label":"模型名称"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"输出目录"', '"label":"Output Directory"')
WHERE fields LIKE '%"label":"输出目录"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"端口号"', '"label":"Port"')
WHERE fields LIKE '%"label":"端口号"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"服务类型"', '"label":"Service Type"')
WHERE fields LIKE '%"label":"服务类型"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否使用SSL"', '"label":"Use SSL"')
WHERE fields LIKE '%"label":"是否使用SSL"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"请求方式"', '"label":"Request Method"')
WHERE fields LIKE '%"label":"请求方式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"请求参数"', '"label":"Request Parameters"')
WHERE fields LIKE '%"label":"请求参数"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"请求头"', '"label":"Request Headers"')
WHERE fields LIKE '%"label":"请求头"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音频格式"', '"label":"Audio Format"')
WHERE fields LIKE '%"label":"音频格式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"访问令牌"', '"label":"Access Token"')
WHERE fields LIKE '%"label":"访问令牌"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"响应格式"', '"label":"Response Format"')
WHERE fields LIKE '%"label":"响应格式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音色"', '"label":"Voice"')
WHERE fields LIKE '%"label":"音色"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"应用密钥"', '"label":"App Key"')
WHERE fields LIKE '%"label":"应用密钥"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"访问密钥ID"', '"label":"Access Key ID"')
WHERE fields LIKE '%"label":"访问密钥ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"访问密钥密码"', '"label":"Access Key Secret"')
WHERE fields LIKE '%"label":"访问密钥密码"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"授权"', '"label":"Authorization"')
WHERE fields LIKE '%"label":"授权"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"速度"', '"label":"Speed"')
WHERE fields LIKE '%"label":"速度"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"温度"', '"label":"Temperature"')
WHERE fields LIKE '%"label":"温度"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音色ID"', '"label":"Voice ID"')
WHERE fields LIKE '%"label":"音色ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"采样率"', '"label":"Sample Rate"')
WHERE fields LIKE '%"label":"采样率"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"参考音频"', '"label":"Reference Audio"')
WHERE fields LIKE '%"label":"参考音频"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"参考文本"', '"label":"Reference Text"')
WHERE fields LIKE '%"label":"参考文本"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否标准化"', '"label":"Normalize"')
WHERE fields LIKE '%"label":"是否标准化"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"最大新令牌数"', '"label":"Max New Tokens"')
WHERE fields LIKE '%"label":"最大新令牌数"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"块长度"', '"label":"Chunk Length"')
WHERE fields LIKE '%"label":"块长度"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"重复惩罚"', '"label":"Repetition Penalty"')
WHERE fields LIKE '%"label":"重复惩罚"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否流式"', '"label":"Streaming"')
WHERE fields LIKE '%"label":"是否流式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否使用内存缓存"', '"label":"Use Memory Cache"')
WHERE fields LIKE '%"label":"是否使用内存缓存"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"种子"', '"label":"Seed"')
WHERE fields LIKE '%"label":"种子"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"通道数"', '"label":"Channels"')
WHERE fields LIKE '%"label":"通道数"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"参考ID"', '"label":"Reference ID"')
WHERE fields LIKE '%"label":"参考ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"组ID"', '"label":"Group ID"')
WHERE fields LIKE '%"label":"组ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"文本语言"', '"label":"Text Language"')
WHERE fields LIKE '%"label":"文本语言"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"参考音频路径"', '"label":"Reference Audio Path"')
WHERE fields LIKE '%"label":"参考音频路径"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"提示文本"', '"label":"Prompt Text"')
WHERE fields LIKE '%"label":"提示文本"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"提示语言"', '"label":"Prompt Language"')
WHERE fields LIKE '%"label":"提示语言"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"文本分割方法"', '"label":"Text Split Method"')
WHERE fields LIKE '%"label":"文本分割方法"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"批处理大小"', '"label":"Batch Size"')
WHERE fields LIKE '%"label":"批处理大小"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"批处理阈值"', '"label":"Batch Threshold"')
WHERE fields LIKE '%"label":"批处理阈值"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否分桶"', '"label":"Split Bucket"')
WHERE fields LIKE '%"label":"是否分桶"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否返回片段"', '"label":"Return Fragment"')
WHERE fields LIKE '%"label":"是否返回片段"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"速度因子"', '"label":"Speed Factor"')
WHERE fields LIKE '%"label":"速度因子"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否流式模式"', '"label":"Streaming Mode"')
WHERE fields LIKE '%"label":"是否流式模式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否并行推理"', '"label":"Parallel Inference"')
WHERE fields LIKE '%"label":"是否并行推理"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"辅助参考音频路径"', '"label":"Auxiliary Reference Audio Paths"')
WHERE fields LIKE '%"label":"辅助参考音频路径"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"切分标点"', '"label":"Cut Punctuation"')
WHERE fields LIKE '%"label":"切分标点"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"输入参考"', '"label":"Input References"')
WHERE fields LIKE '%"label":"输入参考"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"采样步数"', '"label":"Sample Steps"')
WHERE fields LIKE '%"label":"采样步数"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"是否使用SR"', '"label":"Use SR"')
WHERE fields LIKE '%"label":"是否使用SR"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音调因子"', '"label":"Pitch Factor"')
WHERE fields LIKE '%"label":"音调因子"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音量变化"', '"label":"Volume Change dB"')
WHERE fields LIKE '%"label":"音量变化"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"目标语言"', '"label":"Target Language"')
WHERE fields LIKE '%"label":"目标语言"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"格式"', '"label":"Format"')
WHERE fields LIKE '%"label":"格式"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"情感"', '"label":"Emotion"')
WHERE fields LIKE '%"label":"情感"%';
-- Additional field translations
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"应用ID"', '"label":"App ID"')
WHERE fields LIKE '%"label":"应用ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"应用AppID"', '"label":"App ID"')
WHERE fields LIKE '%"label":"应用AppID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"应用AppKey"', '"label":"App Key"')
WHERE fields LIKE '%"label":"应用AppKey"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"临时Token"', '"label":"Temporary Token"')
WHERE fields LIKE '%"label":"临时Token"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"AccessKey ID"', '"label":"Access Key ID"')
WHERE fields LIKE '%"label":"AccessKey ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"AccessKey Secret"', '"label":"Access Key Secret"')
WHERE fields LIKE '%"label":"AccessKey Secret"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"API服务地址"', '"label":"API Service URL"')
WHERE fields LIKE '%"label":"API服务地址"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"API地址"', '"label":"API URL"')
WHERE fields LIKE '%"label":"API地址"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"WebSocket地址"', '"label":"WebSocket URL"')
WHERE fields LIKE '%"label":"WebSocket地址"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"资源ID"', '"label":"Resource ID"')
WHERE fields LIKE '%"label":"资源ID"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"默认音色"', '"label":"Default Voice"')
WHERE fields LIKE '%"label":"默认音色"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"断句检测时间"', '"label":"Sentence Silence Detection Time"')
WHERE fields LIKE '%"label":"断句检测时间"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"集群"', '"label":"Cluster"')
WHERE fields LIKE '%"label":"集群"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"热词文件名称"', '"label":"Hotword File Name"')
WHERE fields LIKE '%"label":"热词文件名称"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"替换词文件名称"', '"label":"Replacement File Name"')
WHERE fields LIKE '%"label":"替换词文件名称"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"区域"', '"label":"Region"')
WHERE fields LIKE '%"label":"区域"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"语言参数"', '"label":"Language Parameter"')
WHERE fields LIKE '%"label":"语言参数"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音量"', '"label":"Volume"')
WHERE fields LIKE '%"label":"音量"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"语速"', '"label":"Speech Rate"')
WHERE fields LIKE '%"label":"语速"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"音调"', '"label":"Pitch"')
WHERE fields LIKE '%"label":"音调"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"检测阈值"', '"label":"Detection Threshold"')
WHERE fields LIKE '%"label":"检测阈值"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"模型目录"', '"label":"Model Directory"')
WHERE fields LIKE '%"label":"模型目录"%';
UPDATE ai_model_provider
SET fields = REPLACE(fields, '"label":"最小静音时长"', '"label":"Min Silence Duration"')
WHERE fields LIKE '%"label":"最小静音时长"%';
-- Update placeholder values in ai_model_config
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的api_key"', '"your_api_key"')
WHERE config_json LIKE '%"你的api_key"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的网关访问密钥"', '"your_gateway_access_key"')
WHERE config_json LIKE '%"你的网关访问密钥"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的app_id"', '"your_app_id"')
WHERE config_json LIKE '%"你的app_id"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的bot_id"', '"your_bot_id"')
WHERE config_json LIKE '%"你的bot_id"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的user_id"', '"your_user_id"')
WHERE config_json LIKE '%"你的user_id"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的personal_access_token"', '"your_personal_access_token"')
WHERE config_json LIKE '%"你的personal_access_token"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的home assistant api访问令牌"', '"your_home_assistant_api_token"')
WHERE config_json LIKE '%"你的home assistant api访问令牌"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的Secret ID"', '"your_secret_id"')
WHERE config_json LIKE '%"你的Secret ID"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的Secret Key"', '"your_secret_key"')
WHERE config_json LIKE '%"你的Secret Key"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的appkey"', '"your_appkey"')
WHERE config_json LIKE '%"你的appkey"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的access_key_id"', '"your_access_key_id"')
WHERE config_json LIKE '%"你的access_key_id"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的access_key_secret"', '"your_access_key_secret"')
WHERE config_json LIKE '%"你的access_key_secret"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的API Key"', '"your_api_key"')
WHERE config_json LIKE '%"你的API Key"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的应用ID"', '"your_app_id"')
WHERE config_json LIKE '%"你的应用ID"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的音色ID"', '"your_voice_id"')
WHERE config_json LIKE '%"你的音色ID"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的访问令牌"', '"your_access_token"')
WHERE config_json LIKE '%"你的访问令牌"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的资源ID"', '"your_resource_id"')
WHERE config_json LIKE '%"你的资源ID"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的默认音色"', '"your_default_voice"')
WHERE config_json LIKE '%"你的默认音色"%';
UPDATE ai_model_config
SET config_json = REPLACE(config_json, '"你的集群"', '"your_cluster"')
WHERE config_json LIKE '%"你的集群"%';

View file

@ -0,0 +1,188 @@
-- Translate model provider names and descriptions from Chinese to English
-- Update provider names
UPDATE ai_model_provider
SET name = 'SileroVAD Voice Activity Detection'
WHERE name = 'SileroVAD语音活动检测';
UPDATE ai_model_provider
SET name = 'FunASR Speech Recognition'
WHERE name = 'FunASR语音识别';
UPDATE ai_model_provider
SET name = 'SherpaASR Speech Recognition'
WHERE name = 'SherpaASR语音识别';
UPDATE ai_model_provider
SET name = 'Volcano Engine Speech Recognition'
WHERE name = '火山引擎语音识别';
UPDATE ai_model_provider
SET name = 'Tencent Speech Recognition'
WHERE name = '腾讯语音识别';
UPDATE ai_model_provider
SET name = 'Tencent Speech Synthesis'
WHERE name = '腾讯语音合成';
UPDATE ai_model_provider
SET name = 'Alibaba Cloud Speech Recognition'
WHERE name = '阿里云语音识别';
UPDATE ai_model_provider
SET name = 'Alibaba Cloud Speech Recognition (Streaming)'
WHERE name = '阿里云语音识别(流式)';
UPDATE ai_model_provider
SET name = 'Baidu Speech Recognition'
WHERE name = '百度语音识别';
UPDATE ai_model_provider
SET name = 'OpenAI Speech Recognition'
WHERE name = 'OpenAI语音识别';
UPDATE ai_model_provider
SET name = 'Volcano Engine Speech Recognition (Streaming)'
WHERE name = '火山引擎语音识别(流式)';
UPDATE ai_model_provider
SET name = 'Alibaba Bailian Interface'
WHERE name = '阿里百炼接口';
UPDATE ai_model_provider
SET name = 'Volcano Engine LLM'
WHERE name = '火山引擎LLM';
UPDATE ai_model_provider
SET name = 'Volcano Engine TTS'
WHERE name = '火山引擎TTS';
UPDATE ai_model_provider
SET name = 'Alibaba Cloud TTS'
WHERE name = '阿里云TTS';
UPDATE ai_model_provider
SET name = 'Volcano Dual-Stream Speech Synthesis'
WHERE name = '火山双流式语音合成';
UPDATE ai_model_provider
SET name = 'Linkerai Speech Synthesis'
WHERE name = 'Linkerai语音合成';
UPDATE ai_model_provider
SET name = 'Alibaba Cloud Speech Synthesis (Streaming)'
WHERE name = '阿里云语音合成(流式)';
UPDATE ai_model_provider
SET name = 'Index-TTS-vLLM Streaming Speech Synthesis'
WHERE name = 'Index-TTS-vLLM流式语音合成';
UPDATE ai_model_provider
SET name = 'Mem0AI Memory'
WHERE name = 'Mem0AI记忆';
UPDATE ai_model_provider
SET name = 'No Memory'
WHERE name = '无记忆';
UPDATE ai_model_provider
SET name = 'Local Short Memory'
WHERE name = '本地短记忆';
UPDATE ai_model_provider
SET name = 'No Intent Recognition'
WHERE name = '无意图识别';
UPDATE ai_model_provider
SET name = 'LLM Intent Recognition'
WHERE name = 'LLM意图识别';
UPDATE ai_model_provider
SET name = 'Function Call Intent Recognition'
WHERE name = '函数调用意图识别';
UPDATE ai_model_provider
SET name = 'FunASR Server Speech Recognition'
WHERE name = 'FunASR服务语音识别';
UPDATE ai_model_provider
SET name = 'MiniMax Speech Synthesis'
WHERE name = 'MiniMax语音合成';
UPDATE ai_model_provider
SET name = 'OpenAI Speech Synthesis'
WHERE name = 'OpenAI语音合成';
-- Update model config names
UPDATE ai_model_config
SET model_name = 'Zhipu AI'
WHERE model_name = '智谱AI';
UPDATE ai_model_config
SET model_name = 'Tongyi Qianwen'
WHERE model_name = '通义千问';
UPDATE ai_model_config
SET model_name = 'Tongyi Bailian'
WHERE model_name = '通义百炼';
UPDATE ai_model_config
SET model_name = 'Doubao Large Model'
WHERE model_name = '豆包大模型';
UPDATE ai_model_config
SET model_name = 'Google Gemini'
WHERE model_name = '谷歌Gemini';
UPDATE ai_model_config
SET model_name = 'Tencent Speech Recognition'
WHERE model_name = '腾讯语音识别';
UPDATE ai_model_config
SET model_name = 'Alibaba Cloud Speech Recognition'
WHERE model_name = '阿里云语音识别';
UPDATE ai_model_config
SET model_name = 'Baidu Speech Recognition'
WHERE model_name = '百度语音识别';
UPDATE ai_model_config
SET model_name = 'MiniMax Speech Synthesis'
WHERE model_name = 'MiniMax语音合成';
UPDATE ai_model_config
SET model_name = 'OpenAI Speech Synthesis'
WHERE model_name = 'OpenAI语音合成';
UPDATE ai_model_config
SET model_name = 'Volcano Dual-Stream Speech Synthesis'
WHERE model_name = '火山双流式语音合成';
UPDATE ai_model_config
SET model_name = 'Linkerai Speech Synthesis'
WHERE model_name = 'Linkerai语音合成';
UPDATE ai_model_config
SET model_name = 'Mem0AI Memory'
WHERE model_name = 'Mem0AI记忆';
UPDATE ai_model_config
SET model_name = 'Function Call Intent Recognition'
WHERE model_name = '函数调用意图识别';
UPDATE ai_model_config
SET model_name = 'Zhipu Visual AI'
WHERE model_name = '智谱视觉AI';
UPDATE ai_model_config
SET model_name = 'Qianwen Visual Model'
WHERE model_name = '千问视觉模型';
UPDATE ai_model_config
SET model_name = 'Volcano Edge Large Model Gateway'
WHERE model_name = '火山引擎边缘大模型网关';
-- Update TTS voice names
UPDATE ai_tts_voice
SET voice_name = 'Alibaba Cloud Xiaoyun'
WHERE voice_name = '阿里云小云';

View file

@ -0,0 +1,22 @@
-- Translate system parameter remarks from Chinese to English
UPDATE sys_params
SET remark = 'Time to disconnect when no voice input (seconds)'
WHERE param_code = 'close_connection_no_voice_time';
UPDATE sys_params
SET remark = 'Wake word list for wake word recognition'
WHERE param_code = 'wakeup_words';
UPDATE sys_params
SET remark = 'Home Assistant API key'
WHERE param_code = 'plugins.home_assistant.api_key';
-- Update any Chinese wake words to English equivalents (optional, can be customized by user)
UPDATE sys_params
SET param_value = 'hello xiaozhi;hey xiaozhi;xiaozhi xiaozhi;hey assistant;hello assistant;wake up;listen to me;hey buddy'
WHERE param_code = 'wakeup_words' AND param_value LIKE '%你好小智%';
-- Translate column comments (if needed for documentation)
-- Note: These are database structure changes, not data changes
-- ALTER TABLE sys_params MODIFY COLUMN remark VARCHAR(255) COMMENT 'Parameter description';

View file

@ -303,3 +303,31 @@ databaseChangeLog:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202508131557.sql
- changeSet:
id: 202501230002_translate_dict_names
author: cheeko
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202501230002_translate_dict_names.sql
- changeSet:
id: 202501230003_translate_provider_fields
author: cheeko
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202501230003_translate_provider_fields.sql
- changeSet:
id: 202501230004_translate_model_names
author: cheeko
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202501230004_translate_model_names.sql
- changeSet:
id: 202501230005_translate_sys_params
author: cheeko
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202501230005_translate_sys_params.sql

View file

@ -369,8 +369,8 @@ onMounted(async () => {
</view>
</view>
<!-- 底部安全距离 -->
<!-- 底部安全距离 -->
<!-- Bottom safe area -->
<!-- Bottom safe area -->
<view style="height: env(safe-area-inset-bottom);" />
</view>
</view>

View file

@ -1 +1 @@
VUE_APP_TITLE=智控台
VUE_APP_TITLE=cheeko

View file

@ -1 +1,2 @@
VUE_APP_API_BASE_URL=/xiaozhi
VUE_APP_API_BASE_URL=/xiaozhi
VUE_APP_TITLE=cheeko

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 724 B

View file

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" type="image/png" href="<%= BASE_URL %>favicon-16x16.png">
<title>
<%= process.env.VUE_APP_TITLE %>
</title>

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

View file

@ -3,7 +3,7 @@
class="center-dialog" >
<div style="margin: 0 18px; text-align: left; padding: 10px; border-radius: 10px;">
<div style="font-size: 30px; color: #3d4566; margin-top: -10px; margin-bottom: 10px; text-align: center;">
修改模型
Edit Model
</div>
<button class="custom-close-btn" @click="dialogVisible = false">
@ -11,14 +11,14 @@
</button>
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
<div style="font-size: 20px; font-weight: bold; color: #3d4566;">模型信息</div>
<div style="font-size: 20px; font-weight: bold; color: #3d4566;">Model Information</div>
<div style="display: flex; align-items: center; gap: 20px;">
<div style="display: flex; align-items: center;">
<span style="margin-right: 8px;">是否启用</span>
<span style="margin-right: 8px;">Enable</span>
<el-switch v-model="form.isEnabled" :active-value="1" :inactive-value="0" class="custom-switch"></el-switch>
</div>
<div style="display: none; align-items: center;">
<span style="margin-right: 8px;">设为默认</span>
<span style="margin-right: 8px;">Set as Default</span>
<el-switch v-model="form.isDefault" :active-value="1" :inactive-value="0" class="custom-switch"></el-switch>
</div>
</div>
@ -28,37 +28,37 @@
<el-form :model="form" ref="form" label-width="100px" label-position="left" class="custom-form">
<div style="display: flex; gap: 20px; margin-bottom: 0;">
<el-form-item label="模型名称" prop="name" style="flex: 1;">
<el-input v-model="form.modelName" placeholder="请输入模型名称" class="custom-input-bg"></el-input>
<el-form-item label="Model Name" prop="name" style="flex: 1;">
<el-input v-model="form.modelName" placeholder="Enter model name" class="custom-input-bg"></el-input>
</el-form-item>
<el-form-item label="模型编码" prop="code" style="flex: 1;">
<el-input v-model="form.modelCode" placeholder="请输入模型编码" class="custom-input-bg"></el-input>
<el-form-item label="Model Code" prop="code" style="flex: 1;">
<el-input v-model="form.modelCode" placeholder="Enter model code" class="custom-input-bg"></el-input>
</el-form-item>
</div>
<div style="display: flex; gap: 20px; margin-bottom: 0;">
<el-form-item label="供应器" prop="supplier" style="flex: 1;">
<el-select v-model="form.configJson.type" placeholder="请选择" class="custom-select custom-input-bg"
<el-form-item label="Provider" prop="supplier" style="flex: 1;">
<el-select v-model="form.configJson.type" placeholder="Please select" class="custom-select custom-input-bg"
style="width: 100%;" @focus="loadProviders" filterable>
<el-option v-for="item in providers" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="排序号" prop="sort" style="flex: 1;">
<el-input v-model.number="form.sort" type="number" placeholder="请输入排序号" class="custom-input-bg"></el-input>
<el-form-item label="Sort Order" prop="sort" style="flex: 1;">
<el-input v-model.number="form.sort" type="number" placeholder="Enter sort order" class="custom-input-bg"></el-input>
</el-form-item>
</div>
<el-form-item label="文档地址" prop="docUrl" style="margin-bottom: 27px;">
<el-input v-model="form.docLink" placeholder="请输入文档地址" class="custom-input-bg"></el-input>
<el-form-item label="Doc URL" prop="docUrl" style="margin-bottom: 27px;">
<el-input v-model="form.docLink" placeholder="Enter documentation URL" class="custom-input-bg"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark" class="prop-remark">
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入模型备注" :autosize="{ minRows: 3, maxRows: 5 }"
<el-form-item label="Remark" prop="remark" class="prop-remark">
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="Enter model remarks" :autosize="{ minRows: 3, maxRows: 5 }"
class="custom-input-bg"></el-input>
</el-form-item>
</el-form>
<div style="font-size: 20px; font-weight: bold; color: #3d4566; margin-bottom: 15px;">调用信息</div>
<div style="font-size: 20px; font-weight: bold; color: #3d4566; margin-bottom: 15px;">Call Information</div>
<div style="height: 2px; background: #e9e9e9; margin-bottom: 22px;"></div>
<el-form :model="form.configJson" ref="callInfoForm" label-width="auto" class="custom-form">
@ -67,7 +67,7 @@
<el-form-item v-for="field in row" :key="field.prop" :label="field.label" :prop="field.prop"
style="flex: 1;">
<template v-if="field.type === 'json-textarea'">
<el-input v-model="fieldJsonMap[field.prop]" type="textarea" :rows="3" placeholder="请输入JSON格式变量(示例:{'key':'value'})"
<el-input v-model="fieldJsonMap[field.prop]" type="textarea" :rows="3" placeholder="Enter JSON format (example: {'key':'value'})"
class="custom-input-bg" @change="(val) => handleJsonChange(field.prop, val)"></el-input>
</template>
<el-input v-else v-model="form.configJson[field.prop]" :placeholder="field.placeholder" :type="field.type"
@ -85,7 +85,7 @@
class="save-btn"
:loading="saving"
:disabled="saving">
保存
Save
</el-button>
</div>
</el-dialog>
@ -115,7 +115,7 @@ export default {
pendingProviderType: null,
pendingModelData: null,
dynamicCallInfoFields: [],
fieldJsonMap: {}, // 用于存储JSON字段的字符串形式
fieldJsonMap: {}, // Store string form of JSON fields
form: {
id: "",
modelType: "",
@ -203,9 +203,9 @@ export default {
}
},
handleSave() {
this.saving = true; // 开始保存加载
this.saving = true; // Start saving loading
// 处理所有JSON字段
// Process all JSON fields
Object.keys(this.fieldJsonMap).forEach(key => {
const parsed = this.validateJson(this.fieldJsonMap[key]);
if (parsed !== null) {
@ -229,11 +229,11 @@ export default {
provideCode: this.form.configJson.type,
formData,
done: () => {
this.saving = false; // 保存完成后回调
this.saving = false; // Callback after save complete
}
});
// 如果父组件不处理done回调,3秒后自动关闭加载状态
// If parent component doesn't handle done callback, auto close loading state after 3 seconds
setTimeout(() => {
this.saving = false;
}, 3000);
@ -262,7 +262,7 @@ export default {
label: f.label,
prop: f.key,
type: f.type === 'dict' ? 'json-textarea' : (f.type === 'password' ? 'password' : 'text'),
placeholder: `请输入${f.label}`
placeholder: `Enter ${f.label}`
}));
if (this.pendingModelData && this.pendingProviderType === providerCode) {
@ -312,13 +312,13 @@ export default {
return parsed;
}
this.$message.error({
message: '必须输入字典格式(如 {"key":"value"}),保存则使用原数据',
message: 'Must enter dictionary format (e.g. {"key":"value"}), original data will be used if saved',
showClose: true
});
return null;
} catch (e) {
this.$message.error({
message: 'JSON格式错误(如 {"key":"value"}),保存则使用原数据',
message: 'JSON format error (e.g. {"key":"value"}), original data will be used if saved',
showClose: true
});
return null;

View file

@ -12,7 +12,9 @@ export default new Vuex.Store({
userInfo: {}, // 添加用户信息存储
isSuperAdmin: false, // 添加superAdmin状态
pubConfig: { // 添加公共配置存储
version: '',
version: '0.7.5',
name: 'cheeko-server',
year: '©2025',
beianIcpNum: 'null',
beianGaNum: 'null',
allowUserRegister: false
@ -50,7 +52,14 @@ export default new Vuex.Store({
localStorage.setItem('isSuperAdmin', isSuperAdmin)
},
setPubConfig(state, config) {
state.pubConfig = config
state.pubConfig = {
version: config.version || '0.7.5',
name: config.name || 'cheeko-server',
year: config.year || '©2025',
beianIcpNum: config.beianIcpNum || 'null',
beianGaNum: config.beianGaNum || 'null',
allowUserRegister: config.allowUserRegister || false
}
},
clearAuth(state) {
state.token = ''

View file

@ -15,10 +15,10 @@
</div>
</div>
<!-- 主体内容 -->
<!-- Main Content -->
<div class="main-wrapper">
<div class="content-panel">
<!-- 左侧字典类型列表 -->
<!-- Left side dictionary type list -->
<div class="dict-type-panel">
<div class="dict-type-header">
<el-button type="success" size="mini" @click="showAddDictTypeDialog">Add Dictionary Type</el-button>
@ -42,7 +42,7 @@
</el-table>
</div>
<!-- 右侧字典数据列表 -->
<!-- Right side dictionary data list -->
<div class="content-area">
<el-card class="dict-data-card" shadow="never">
<el-table ref="dictDataTable" :data="dictDataList" style="width: 100%"
@ -111,11 +111,11 @@
</div>
</div>
<!-- 使用字典类型编辑弹框组件 -->
<!-- Dictionary type edit dialog component -->
<DictTypeDialog :visible.sync="dictTypeDialogVisible" :title="dictTypeDialogTitle" :dictTypeData="dictTypeForm"
@save="saveDictType" />
<!-- 使用字典数据编辑弹框组件 -->
<!-- Dictionary data edit dialog component -->
<DictDataDialog :visible.sync="dictDataDialogVisible" :title="dictDataDialogTitle" :dictData="dictDataForm"
:dictTypeId="selectedDictType?.id" @save="saveDictData" />
<el-footer style="flex-shrink:unset;">
@ -140,11 +140,11 @@ export default {
},
data() {
return {
// 字典类型相关
// Dictionary type related
dictTypeList: [],
dictTypeLoading: false,
selectedDictType: null,
selectedDictTypes: [], // 恢复多选数组
selectedDictTypes: [], // Restore multi-select array
dictTypeDialogVisible: false,
dictTypeDialogTitle: 'Add Dictionary Type',
dictTypeForm: {
@ -153,7 +153,7 @@ export default {
dictType: ''
},
// 字典数据相关
// Dictionary data related
dictDataList: [],
dictDataLoading: false,
isAllDictDataSelected: false,
@ -167,7 +167,7 @@ export default {
sort: 0
},
search: '',
// 添加分页相关数据
// Add pagination related data
pageSizeOptions: [10, 20, 50, 100],
currentPage: 1,
pageSize: 10,
@ -178,7 +178,7 @@ export default {
this.loadDictTypeList()
},
methods: {
// 字典类型相关方法
// Dictionary type related methods
loadDictTypeList() {
this.dictTypeLoading = true
dictApi.getDictTypeList({
@ -255,7 +255,7 @@ export default {
})
},
// 字典数据相关方法
// Dictionary data related methods
loadDictDataList(dictTypeId) {
if (!dictTypeId) return
this.dictDataLoading = true
@ -273,7 +273,7 @@ export default {
}))
this.total = data.data.total
} else {
this.$message.error(data.msg || '获取字典数据失败')
this.$message.error(data.msg || 'Failed to get dictionary data')
}
this.dictDataLoading = false
})
@ -286,7 +286,7 @@ export default {
},
showAddDictDataDialog() {
if (!this.selectedDictType) {
this.$message.warning('请先选择字典类型')
this.$message.warning('Please select a dictionary type first')
return
}
this.dictDataDialogTitle = 'Add Dictionary Data'
@ -351,13 +351,13 @@ export default {
},
handleSearch() {
if (!this.selectedDictType) {
this.$message.warning('请先选择字典类型')
this.$message.warning('Please select a dictionary type first')
return
}
this.currentPage = 1
this.loadDictDataList(this.selectedDictType.id)
},
// 添加分页相关方法
// Add pagination related methods
handlePageSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;

View file

@ -3,12 +3,12 @@
<el-container style="height: 100%;">
<el-header>
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.svg" style="width: 45px;height: 45px;" />
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" />
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.svg" style="width: 65px;height: 65px;" />
<!-- <img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" /> -->
</div>
</el-header>
<div class="login-person">
<img loading="lazy" alt="" src="@/assets/login/login-person.png" style="width: 100%;" />
<!-- <img loading="lazy" alt="" src="@/assets/login/login-person.png" style="width: 100%;" /> -->
</div>
<el-main style="position: relative;">
<div class="login-box" @keyup.enter="login">

View file

@ -1,11 +1,11 @@
<template>
<div class="welcome" @keyup.enter="register">
<el-container style="height: 100%;">
<!-- 保持相同的头部 -->
<!-- Keep the same header -->
<el-header>
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.svg" style="width: 45px;height: 45px;" />
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" />
<!-- <img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" /> -->
</div>
</el-header>
<div class="login-person">
@ -13,10 +13,10 @@
</div>
<el-main style="position: relative;">
<div class="login-box">
<!-- 修改标题部分 -->
<!-- Title section -->
<div style="display: flex;align-items: center;gap: 20px;margin-bottom: 39px;padding: 0 30px;">
<img loading="lazy" alt="" src="@/assets/login/hi.png" style="width: 34px;height: 34px;" />
<div class="login-text">注册</div>
<div class="login-text">Register</div>
<div class="login-welcome">
WELCOME TO REGISTER
</div>
@ -24,13 +24,13 @@
<div style="padding: 0 30px;">
<form @submit.prevent="register">
<!-- 用户名/手机号输入框 -->
<!-- Username/phone input box -->
<div class="input-box" v-if="!enableMobileRegister">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/username.png" />
<el-input v-model="form.username" placeholder="请输入用户名" />
<el-input v-model="form.username" placeholder="Enter username" />
</div>
<!-- 手机号注册部分 -->
<!-- Mobile registration section -->
<template v-if="enableMobileRegister">
<div class="input-box">
<div style="display: flex; align-items: center; width: 100%;">
@ -38,79 +38,79 @@
<el-option v-for="item in mobileAreaList" :key="item.key" :label="`${item.name} (${item.key})`"
:value="item.key" />
</el-select>
<el-input v-model="form.mobile" placeholder="请输入手机号码" />
<el-input v-model="form.mobile" placeholder="Enter phone number" />
</div>
</div>
<div style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/shield.png" />
<el-input v-model="form.captcha" placeholder="请输入验证码" style="flex: 1;" />
<el-input v-model="form.captcha" placeholder="Enter verification code" style="flex: 1;" />
</div>
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="验证码"
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="Captcha"
style="width: 150px; height: 40px; cursor: pointer;" @click="fetchCaptcha" />
</div>
<!-- 手机验证码 -->
<!-- Mobile verification code -->
<div style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/phone.png" />
<el-input v-model="form.mobileCaptcha" placeholder="请输入手机验证码" style="flex: 1;" maxlength="6" />
<el-input v-model="form.mobileCaptcha" placeholder="Enter SMS code" style="flex: 1;" maxlength="6" />
</div>
<el-button type="primary" class="send-captcha-btn" :disabled="!canSendMobileCaptcha"
@click="sendMobileCaptcha">
<span>
{{ countdown > 0 ? `${countdown}秒后重试` : '发送验证码' }}
{{ countdown > 0 ? `Retry in ${countdown}s` : 'Send Code' }}
</span>
</el-button>
</div>
</template>
<!-- 密码输入框 -->
<!-- Password input box -->
<div class="input-box">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/password.png" />
<el-input v-model="form.password" placeholder="请输入密码" type="password" show-password />
<el-input v-model="form.password" placeholder="Enter password" type="password" show-password />
</div>
<!-- 新增确认密码 -->
<!-- Confirm password -->
<div class="input-box">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/password.png" />
<el-input v-model="form.confirmPassword" placeholder="请确认密码" type="password" show-password />
<el-input v-model="form.confirmPassword" placeholder="Confirm password" type="password" show-password />
</div>
<!-- 验证码部分保持相同 -->
<!-- Captcha section -->
<div v-if="!enableMobileRegister"
style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/shield.png" />
<el-input v-model="form.captcha" placeholder="请输入验证码" style="flex: 1;" />
<el-input v-model="form.captcha" placeholder="Enter verification code" style="flex: 1;" />
</div>
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="验证码"
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="Captcha"
style="width: 150px; height: 40px; cursor: pointer;" @click="fetchCaptcha" />
</div>
<!-- 修改底部链接 -->
<!-- Bottom link -->
<div style="font-weight: 400;font-size: 14px;text-align: left;color: #5778ff;margin-top: 20px;">
<div style="cursor: pointer;" @click="goToLogin">已有账号?立即登录</div>
<div style="cursor: pointer;" @click="goToLogin">Already have an account? Login now</div>
</div>
</form>
</div>
<!-- 修改按钮文本 -->
<div class="login-btn" @click="register">立即注册</div>
<!-- Button text -->
<div class="login-btn" @click="register">Register Now</div>
<!-- 保持相同的协议声明 -->
<!-- Agreement declaration -->
<div style="font-size: 14px;color: #979db1;">
注册即同意
<div style="display: inline-block;color: #5778FF;cursor: pointer;">《用户协议》</div>
和
<div style="display: inline-block;color: #5778FF;cursor: pointer;">《隐私政策》</div>
By registering, you agree to the
<div style="display: inline-block;color: #5778FF;cursor: pointer;">Terms of Service</div>
and
<div style="display: inline-block;color: #5778FF;cursor: pointer;">Privacy Policy</div>
</div>
</div>
</el-main>
<!-- 保持相同的页脚 -->
<!-- Footer -->
<el-footer>
<version-footer />
</el-footer>
@ -159,7 +159,7 @@ export default {
mounted() {
this.$store.dispatch('fetchPubConfig').then(() => {
if (!this.allowUserRegister) {
showDanger('当前不允许普通用户注册');
showDanger('User registration is currently not allowed');
setTimeout(() => {
goToPage('/login');
}, 1500);
@ -168,7 +168,7 @@ export default {
this.fetchCaptcha();
},
methods: {
// 复用验证码获取方法
// Reuse captcha fetch method
fetchCaptcha() {
this.form.captchaId = getUUID();
Api.user.getCaptcha(this.form.captchaId, (res) => {
@ -177,13 +177,13 @@ export default {
this.captchaUrl = URL.createObjectURL(blob);
} else {
console.error('验证码加载异常:', error);
showDanger('验证码加载失败,点击刷新');
console.error('Captcha loading error:', error);
showDanger('Failed to load captcha, click to refresh');
}
});
},
// 封装输入验证逻辑
// Encapsulate input validation logic
validateInput(input, message) {
if (!input.trim()) {
showDanger(message);
@ -192,26 +192,26 @@ export default {
return true;
},
// 发送手机验证码
// Send mobile verification code
sendMobileCaptcha() {
if (!validateMobile(this.form.mobile, this.form.areaCode)) {
showDanger('请输入正确的手机号码');
showDanger('Please enter a valid phone number');
return;
}
// 验证图形验证码
if (!this.validateInput(this.form.captcha, '请输入图形验证码')) {
// Verify captcha
if (!this.validateInput(this.form.captcha, 'Please enter the captcha')) {
this.fetchCaptcha();
return;
}
// 清除可能存在的旧定时器
// Clear any existing timer
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
// 开始倒计时
// Start countdown
this.countdown = 60;
this.timer = setInterval(() => {
if (this.countdown > 0) {
@ -222,49 +222,49 @@ export default {
}
}, 1000);
// 调用发送验证码接口
// Call send verification code API
Api.user.sendSmsVerification({
phone: this.form.areaCode + this.form.mobile,
captcha: this.form.captcha,
captchaId: this.form.captchaId
}, (res) => {
showSuccess('验证码发送成功');
showSuccess('Verification code sent successfully');
}, (err) => {
showDanger(err.data.msg || '验证码发送失败');
showDanger(err.data.msg || 'Failed to send verification code');
this.countdown = 0;
this.fetchCaptcha();
});
},
// 注册逻辑
// Registration logic
register() {
if (this.enableMobileRegister) {
// 手机号注册验证
// Mobile registration validation
if (!validateMobile(this.form.mobile, this.form.areaCode)) {
showDanger('请输入正确的手机号码');
showDanger('Please enter a valid phone number');
return;
}
if (!this.form.mobileCaptcha) {
showDanger('请输入手机验证码');
showDanger('Please enter the SMS verification code');
return;
}
} else {
// 用户名注册验证
if (!this.validateInput(this.form.username, '用户名不能为空')) {
// Username registration validation
if (!this.validateInput(this.form.username, 'Username cannot be empty')) {
return;
}
}
// 验证密码
if (!this.validateInput(this.form.password, '密码不能为空')) {
// Validate password
if (!this.validateInput(this.form.password, 'Password cannot be empty')) {
return;
}
if (this.form.password !== this.form.confirmPassword) {
showDanger('两次输入的密码不一致')
showDanger('Passwords do not match')
return
}
// 验证验证码
if (!this.validateInput(this.form.captcha, '验证码不能为空')) {
// Validate captcha
if (!this.validateInput(this.form.captcha, 'Verification code cannot be empty')) {
return;
}
@ -273,11 +273,11 @@ export default {
}
Api.user.register(this.form, ({ data }) => {
showSuccess('注册成功!')
showSuccess('Registration successful!')
goToPage('/login')
}, (err) => {
showDanger(err.data.msg || '注册失败')
if (err.data != null && err.data.msg != null && err.data.msg.indexOf('图形验证码') > -1) {
showDanger(err.data.msg || 'Registration failed')
if (err.data != null && err.data.msg != null && (err.data.msg.indexOf('captcha') > -1 || err.data.msg.indexOf('图形验证码') > -1)) {
this.fetchCaptcha()
}
})

View file

@ -1,11 +1,11 @@
<template>
<div class="welcome" @keyup.enter="retrievePassword">
<el-container style="height: 100%;">
<!-- 保持相同的头部 -->
<!-- Keep the same header -->
<el-header>
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.svg" style="width: 45px;height: 45px;" />
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" />
<!-- <img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" /> -->
</div>
</el-header>
<div class="login-person">
@ -14,83 +14,83 @@
<el-main style="position: relative;">
<form @submit.prevent="retrievePassword">
<div class="login-box">
<!-- 修改标题部分 -->
<!-- Title section -->
<div style="display: flex;align-items: center;gap: 20px;margin-bottom: 39px;padding: 0 30px;">
<img loading="lazy" alt="" src="@/assets/login/hi.png" style="width: 34px;height: 34px;" />
<div class="login-text">重置密码</div>
<div class="login-text">Reset Password</div>
<div class="login-welcome">
PASSWORD RETRIEVE
</div>
</div>
<div style="padding: 0 30px;">
<!-- 手机号输入 -->
<!-- Phone number input -->
<div class="input-box">
<div style="display: flex; align-items: center; width: 100%;">
<el-select v-model="form.areaCode" style="width: 220px; margin-right: 10px;">
<el-option v-for="item in mobileAreaList" :key="item.key" :label="`${item.name} (${item.key})`"
:value="item.key" />
</el-select>
<el-input v-model="form.mobile" placeholder="请输入手机号码" />
<el-input v-model="form.mobile" placeholder="Enter phone number" />
</div>
</div>
<div style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/shield.png" />
<el-input v-model="form.captcha" placeholder="请输入验证码" style="flex: 1;" />
<el-input v-model="form.captcha" placeholder="Enter verification code" style="flex: 1;" />
</div>
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="验证码"
<img loading="lazy" v-if="captchaUrl" :src="captchaUrl" alt="Captcha"
style="width: 150px; height: 40px; cursor: pointer;" @click="fetchCaptcha" />
</div>
<!-- 手机验证码 -->
<!-- Mobile verification code -->
<div style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/phone.png" />
<el-input v-model="form.mobileCaptcha" placeholder="请输入手机验证码" style="flex: 1;" maxlength="6" />
<el-input v-model="form.mobileCaptcha" placeholder="Enter SMS code" style="flex: 1;" maxlength="6" />
</div>
<el-button type="primary" class="send-captcha-btn" :disabled="!canSendMobileCaptcha"
@click="sendMobileCaptcha">
<span>
{{ countdown > 0 ? `${countdown}秒后重试` : '发送验证码' }}
{{ countdown > 0 ? `Retry in ${countdown}s` : 'Send Code' }}
</span>
</el-button>
</div>
<!-- 新密码 -->
<!-- New password -->
<div class="input-box">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/password.png" />
<el-input v-model="form.newPassword" placeholder="请输入新密码" type="password" show-password />
<el-input v-model="form.newPassword" placeholder="Enter new password" type="password" show-password />
</div>
<!-- 确认新密码 -->
<!-- Confirm new password -->
<div class="input-box">
<img loading="lazy" alt="" class="input-icon" src="@/assets/login/password.png" />
<el-input v-model="form.confirmPassword" placeholder="请确认新密码" type="password" show-password />
<el-input v-model="form.confirmPassword" placeholder="Confirm new password" type="password" show-password />
</div>
<!-- 修改底部链接 -->
<!-- Bottom link -->
<div style="font-weight: 400;font-size: 14px;text-align: left;color: #5778ff;margin-top: 20px;">
<div style="cursor: pointer;" @click="goToLogin">返回登录</div>
<div style="cursor: pointer;" @click="goToLogin">Back to Login</div>
</div>
</div>
<!-- 修改按钮文本 -->
<div class="login-btn" @click="retrievePassword">立即修改</div>
<!-- Button text -->
<div class="login-btn" @click="retrievePassword">Reset Now</div>
<!-- 保持相同的协议声明 -->
<!-- Agreement declaration -->
<div style="font-size: 14px;color: #979db1;">
同意
<div style="display: inline-block;color: #5778FF;cursor: pointer;">《用户协议》</div>
和
<div style="display: inline-block;color: #5778FF;cursor: pointer;">《隐私政策》</div>
By continuing, you agree to the
<div style="display: inline-block;color: #5778FF;cursor: pointer;">Terms of Service</div>
and
<div style="display: inline-block;color: #5778FF;cursor: pointer;">Privacy Policy</div>
</div>
</div>
</form>
</el-main>
<!-- 保持相同的页脚 -->
<!-- Footer -->
<el-footer>
<version-footer />
</el-footer>

15
translate_dict_names.sql Normal file
View file

@ -0,0 +1,15 @@
-- Translate Chinese dictionary type names to English
-- Run this SQL in your Railway MySQL database
USE railway;
-- Update dictionary type names from Chinese to English
UPDATE `sys_dict_type` SET `dict_name` = 'Mobile Area' WHERE `dict_type` = 'MOBILE_AREA';
UPDATE `sys_dict_type` SET `dict_name` = 'Firmware Type' WHERE `dict_type` = 'FIRMWARE_TYPE';
-- Also update remarks to English
UPDATE `sys_dict_type` SET `remark` = 'Mobile area codes dictionary' WHERE `dict_type` = 'MOBILE_AREA';
UPDATE `sys_dict_type` SET `remark` = 'Firmware types dictionary' WHERE `dict_type` = 'FIRMWARE_TYPE';
-- Verify the changes
SELECT id, dict_type, dict_name, remark FROM sys_dict_type WHERE dict_type IN ('MOBILE_AREA', 'FIRMWARE_TYPE');