From e6704657fd86da0f605a269cc492454903b5fe95 Mon Sep 17 00:00:00 2001 From: rahulpscraftech360 Date: Fri, 22 Aug 2025 21:07:17 +0530 Subject: [PATCH] tables are translated --- README.md | 2 +- main/README.md | 4 +- .../controller/AgentVoicePrintController.java | 20 +- .../service/impl/ConfigServiceImpl.java | 10 +- .../device/controller/DeviceController.java | 2 +- .../device/controller/OTAController.java | 2 +- .../device/controller/OTAMagController.java | 2 +- .../service/impl/DeviceServiceImpl.java | 3 + main/manager-mobile/src/pages/agent/edit.vue | 2 +- main/manager-mobile/src/pages/agent/index.vue | 2 +- main/manager-mobile/src/pages/index/index.vue | 2 +- .../src/pages/settings/index.vue | 4 +- main/manager-web/src/assets/xiaozhi-logo.png | Bin 13372 -> 0 bytes main/manager-web/src/assets/xiaozhi-logo.svg | 33 +++ .../src/components/ChatHistoryDialog.vue | 2 +- .../manager-web/src/components/DeviceItem.vue | 40 ++-- .../src/components/DictDataDialog.vue | 20 +- .../src/components/DictTypeDialog.vue | 18 +- .../src/components/FunctionDialog.vue | 54 ++--- main/manager-web/src/components/HeaderBar.vue | 46 ++-- .../src/components/ParamDialog.vue | 38 ++-- .../src/components/ProviderDialog.vue | 2 +- .../src/components/VoicePrintDialog.vue | 38 ++-- main/manager-web/src/router/index.js | 4 +- .../src/views/DeviceManagement.vue | 2 +- main/manager-web/src/views/DictManagement.vue | 94 ++++---- main/manager-web/src/views/ModelConfig.vue | 152 ++++++------- main/manager-web/src/views/OtaManagement.vue | 98 ++++---- .../src/views/ParamsManagement.vue | 72 +++--- .../src/views/ProviderManagement.vue | 66 +++--- .../src/views/ServerSideManager.vue | 41 ++-- main/manager-web/src/views/UserManagement.vue | 112 ++++----- main/manager-web/src/views/VoicePrint.vue | 52 ++--- main/manager-web/src/views/home.vue | 8 +- main/manager-web/src/views/login.vue | 48 ++-- main/manager-web/src/views/register.vue | 2 +- .../src/views/retrievePassword.vue | 2 +- main/manager-web/src/views/roleConfig.vue | 84 +++---- main/xiaozhi-server/check_edge_voices.py | 167 ++++++++++++++ main/xiaozhi-server/check_tables.py | 41 ++++ main/xiaozhi-server/check_tts_models.py | 76 +++++++ main/xiaozhi-server/client.py | 6 +- .../complete_params_translation.py | 101 +++++++++ main/xiaozhi-server/config/config_loader.py | 30 ++- main/xiaozhi-server/core/api/ota_handler.py | 12 +- main/xiaozhi-server/final_language_update.py | 89 ++++++++ main/xiaozhi-server/fix_groq_model_id.py | 97 ++++++++ main/xiaozhi-server/fix_model_ids.py | 156 +++++++++++++ .../translate_params_remarks.py | 213 ++++++++++++++++++ main/xiaozhi-server/update_all_chinese.py | 120 ++++++++++ main/xiaozhi-server/update_edge_voices.py | 137 +++++++++++ main/xiaozhi-server/update_languages.py | 87 +++++++ main/xiaozhi-server/update_tts_models.py | 116 ++++++++++ 53 files changed, 2046 insertions(+), 585 deletions(-) delete mode 100644 main/manager-web/src/assets/xiaozhi-logo.png create mode 100644 main/manager-web/src/assets/xiaozhi-logo.svg create mode 100644 main/xiaozhi-server/check_edge_voices.py create mode 100644 main/xiaozhi-server/check_tables.py create mode 100644 main/xiaozhi-server/check_tts_models.py create mode 100644 main/xiaozhi-server/complete_params_translation.py create mode 100644 main/xiaozhi-server/final_language_update.py create mode 100644 main/xiaozhi-server/fix_groq_model_id.py create mode 100644 main/xiaozhi-server/fix_model_ids.py create mode 100644 main/xiaozhi-server/translate_params_remarks.py create mode 100644 main/xiaozhi-server/update_all_chinese.py create mode 100644 main/xiaozhi-server/update_edge_voices.py create mode 100644 main/xiaozhi-server/update_languages.py create mode 100644 main/xiaozhi-server/update_tts_models.py diff --git a/README.md b/README.md index c3a8e5fc6..fa7bca8b9 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ Websocket接口地址: wss://2662r3426b.vicp.fun/xiaozhi/v1/ | 意图识别系统 | 支持LLM意图识别、Function Call函数调用,提供插件化意图处理机制 | | 记忆系统 | 支持本地短期记忆、mem0ai接口记忆,具备记忆总结功能 | | 工具调用 | 支持客户端IOT协议、客户MCP协议、服务端MCP协议、MCP接入点协议、自定义工具函数 | -| 管理后台 | 提供Web管理界面,支持用户管理、系统配置和设备管理 | +| 管理后台 | 提供Web管理界面,支持用户管理、系统配置和Device Management | | 测试工具 | 提供性能测试工具、视觉模型测试工具和音频交互测试工具 | | 部署支持 | 支持Docker部署和本地部署,提供完整的配置文件管理 | | 插件系统 | 支持功能插件扩展、自定义插件开发和插件热加载 | diff --git a/main/README.md b/main/README.md index c1f23518d..127a0bb82 100644 --- a/main/README.md +++ b/main/README.md @@ -179,7 +179,7 @@ xiaozhi-esp32-server * **关键实现细节:** 1. **模块化项目结构 (`modules/` 包):** - * `manager-api` 的核心业务逻辑被清晰地划分到 `src/main/java/xiaozhi/modules/` 目录下的不同模块中。这种按功能领域划分模块的方式(例如 `sys` 负责系统管理,`agent` 负责智能体配置,`device` 负责设备管理,`config` 负责为`xiaozhi-server`提供配置,`security` 负责安全,`timbre` 负责音色管理,`ota` 负责固件升级)极大地提高了代码的可维护性和可扩展性。 + * `manager-api` 的核心业务逻辑被清晰地划分到 `src/main/java/xiaozhi/modules/` 目录下的不同模块中。这种按功能领域划分模块的方式(例如 `sys` 负责系统管理,`agent` 负责智能体配置,`device` 负责Device Management,`config` 负责为`xiaozhi-server`提供配置,`security` 负责安全,`timbre` 负责音色管理,`ota` 负责固件升级)极大地提高了代码的可维护性和可扩展性。 * **各模块内部结构:** 每个业务模块通常遵循经典的三层架构或其变体: * **Controller (控制层):** 位于 `xiaozhi.modules.[模块名].controller`。 * **Service (服务层):** 位于 `xiaozhi.modules.[模块名].service`。 @@ -257,7 +257,7 @@ xiaozhi-esp32-server * 用户界面由一系列可复用的Vue组件 (`.vue` 单文件组件) 构成,形成一个组件树。这种方式提高了代码的模块化程度、可维护性和复用性。 * **`src/main.js`:** 应用的入口JS文件。它负责创建和初始化根Vue实例,注册全局插件(如Vue Router, Vuex, Element UI),并把根Vue实例挂载到 `public/index.html` 中的某个DOM元素上(通常是 `#app`)。 * **`src/App.vue`:** 应用的根组件。它通常定义了应用的基础布局结构(如包含导航栏、侧边栏、主内容区),并通过 `` 标签来显示当前路由匹配到的视图组件。 - * **视图组件 (`src/views/`):** 这些组件代表了应用中的各个“页面”或主要功能区(例如 `Login.vue` 登录页, `DeviceManagement.vue` 设备管理页, `UserManagement.vue` 用户管理页, `ModelConfig.vue` 模型配置页)。它们通常由Vue Router直接映射。 + * **视图组件 (`src/views/`):** 这些组件代表了应用中的各个“页面”或主要功能区(例如 `Login.vue` 登录页, `DeviceManagement.vue` Device Management页, `UserManagement.vue` 用户管理页, `ModelConfig.vue` 模型配置页)。它们通常由Vue Router直接映射。 * **可复用UI组件 (`src/components/`):** 包含了在不同视图之间共享的、更小粒度的UI组件(例如 `HeaderBar.vue` 顶部导航栏, `AddDeviceDialog.vue` 添加设备对话框, `AudioPlayer.vue` 音频播放器组件)。 3. **客户端路由 (`src/router/index.js`):** diff --git a/main/manager-api/src/main/java/xiaozhi/modules/agent/controller/AgentVoicePrintController.java b/main/manager-api/src/main/java/xiaozhi/modules/agent/controller/AgentVoicePrintController.java index 1615cee5f..ed6126428 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/agent/controller/AgentVoicePrintController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/agent/controller/AgentVoicePrintController.java @@ -26,7 +26,7 @@ import xiaozhi.modules.agent.vo.AgentVoicePrintVO; import xiaozhi.modules.security.user.SecurityUser; import xiaozhi.modules.sys.service.SysParamsService; -@Tag(name = "智能体声纹管理") +@Tag(name = "Agent Voice Print Management") @AllArgsConstructor @RestController @RequestMapping("/agent/voice-print") @@ -35,18 +35,18 @@ public class AgentVoicePrintController { private final SysParamsService sysParamsService; @PostMapping - @Operation(summary = "创建智能体的声纹") + @Operation(summary = "Create agent voice print") @RequiresPermissions("sys:role:normal") public Result save(@RequestBody @Valid AgentVoicePrintSaveDTO dto) { boolean b = agentVoicePrintService.insert(dto); if (b) { return new Result<>(); } - return new Result().error("智能体的声纹创建失败"); + return new Result().error("Failed to create agent voice print"); } @PutMapping - @Operation(summary = "更新智能体的对应声纹") + @Operation(summary = "Update agent voice print") @RequiresPermissions("sys:role:normal") public Result update(@RequestBody @Valid AgentVoicePrintUpdateDTO dto) { Long userId = SecurityUser.getUserId(); @@ -54,29 +54,29 @@ public class AgentVoicePrintController { if (b) { return new Result<>(); } - return new Result().error("智能体的对应声纹更新失败"); + return new Result().error("Failed to update agent voice print"); } @DeleteMapping("/{id}") - @Operation(summary = "删除智能体对应声纹") + @Operation(summary = "Delete agent voice print") @RequiresPermissions("sys:role:normal") public Result delete(@PathVariable String id) { Long userId = SecurityUser.getUserId(); - // 先删除关联的设备 + // First delete associated devices boolean delete = agentVoicePrintService.delete(userId, id); if (delete) { return new Result<>(); } - return new Result().error("智能体的对应声纹删除失败"); + return new Result().error("Failed to delete agent voice print"); } @GetMapping("/list/{id}") - @Operation(summary = "获取用户指定智能体声纹列表") + @Operation(summary = "Get user specified agent voice print list") @RequiresPermissions("sys:role:normal") public Result> list(@PathVariable String id) { String voiceprintUrl = sysParamsService.getValue("server.voice_print", true); if (StringUtils.isBlank(voiceprintUrl) || "null".equals(voiceprintUrl)) { - throw new RenException("声纹接口未配置,请先在参数配置中配置声纹接口地址(server.voice_print)"); + throw new RenException("Voice print interface not configured, please configure the voice print interface address in parameter settings (server.voice_print)"); } Long userId = SecurityUser.getUserId(); List list = agentVoicePrintService.list(userId, id); diff --git a/main/manager-api/src/main/java/xiaozhi/modules/config/service/impl/ConfigServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/config/service/impl/ConfigServiceImpl.java index 476f09cdf..5eed96066 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/config/service/impl/ConfigServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/config/service/impl/ConfigServiceImpl.java @@ -83,11 +83,11 @@ public class ConfigServiceImpl implements ConfigService { null, agent.getVadModelId(), agent.getAsrModelId(), - null, - null, - null, - null, - null, + agent.getLlmModelId(), // Add this + agent.getVllmModelId(), // Add this + agent.getTtsModelId(), // Add this + agent.getMemModelId(), // Add this + agent.getIntentModelId(), // Add this result, isCache); diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java index b0320e3c8..a23e9f81c 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/DeviceController.java @@ -30,7 +30,7 @@ import xiaozhi.modules.device.entity.DeviceEntity; import xiaozhi.modules.device.service.DeviceService; import xiaozhi.modules.security.user.SecurityUser; -@Tag(name = "设备管理") +@Tag(name = "Device Management") @AllArgsConstructor @RestController @RequestMapping("/device") diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAController.java b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAController.java index 023510cd1..afe50835d 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAController.java @@ -30,7 +30,7 @@ import xiaozhi.modules.device.entity.DeviceEntity; import xiaozhi.modules.device.service.DeviceService; import xiaozhi.modules.sys.service.SysParamsService; -@Tag(name = "设备管理", description = "OTA 相关接口") +@Tag(name = "Device Management", description = "OTA 相关接口") @Slf4j @RestController @RequiredArgsConstructor diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java index bbe0c66ae..cc15ecc40 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java @@ -44,7 +44,7 @@ import xiaozhi.common.validator.ValidatorUtils; import xiaozhi.modules.device.entity.OtaEntity; import xiaozhi.modules.device.service.OtaService; -@Tag(name = "设备管理", description = "OTA 相关接口") +@Tag(name = "Device Management", description = "OTA 相关接口") @Slf4j @RestController @RequiredArgsConstructor diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/service/impl/DeviceServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/device/service/impl/DeviceServiceImpl.java index 3cff111db..4e9e262b1 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/service/impl/DeviceServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/service/impl/DeviceServiceImpl.java @@ -315,12 +315,15 @@ public class DeviceServiceImpl extends BaseServiceImpl String frontedUrl = sysParamsService.getValue(Constant.SERVER_FRONTED_URL, true); code.setMessage(frontedUrl + "\n" + cachedCode); code.setChallenge(deviceId); + log.info("📱 Device {} requesting activation - Using cached code: {}", deviceId, cachedCode); } else { String newCode = RandomUtil.randomNumbers(6); code.setCode(newCode); String frontedUrl = sysParamsService.getValue(Constant.SERVER_FRONTED_URL, true); code.setMessage(frontedUrl + "\n" + newCode); code.setChallenge(deviceId); + log.info("🔐 Generated NEW activation code for device {}: {}", deviceId, newCode); + log.info("📱 Please bind device using code: {} at {}", newCode, frontedUrl); Map dataMap = new HashMap<>(); dataMap.put("id", deviceId); diff --git a/main/manager-mobile/src/pages/agent/edit.vue b/main/manager-mobile/src/pages/agent/edit.vue index 146a84178..dddcc38fd 100644 --- a/main/manager-mobile/src/pages/agent/edit.vue +++ b/main/manager-mobile/src/pages/agent/edit.vue @@ -99,7 +99,7 @@ const tabList = [ activeIcon: '/static/tabbar/robot_activate.png', }, { - label: '设备管理', + label: 'Device Management', value: 'category', icon: '/static/tabbar/device.png', activeIcon: '/static/tabbar/device_activate.png', diff --git a/main/manager-mobile/src/pages/agent/index.vue b/main/manager-mobile/src/pages/agent/index.vue index 9e81b6630..9b8cd42c9 100644 --- a/main/manager-mobile/src/pages/agent/index.vue +++ b/main/manager-mobile/src/pages/agent/index.vue @@ -71,7 +71,7 @@ const tabList = [ activeIcon: '/static/tabbar/robot_activate.png', }, { - label: '设备管理', + label: 'Device Management', value: 'device-management', icon: '/static/tabbar/device.png', activeIcon: '/static/tabbar/device_activate.png', diff --git a/main/manager-mobile/src/pages/index/index.vue b/main/manager-mobile/src/pages/index/index.vue index bb74ab1c1..639c16412 100644 --- a/main/manager-mobile/src/pages/index/index.vue +++ b/main/manager-mobile/src/pages/index/index.vue @@ -227,7 +227,7 @@ onShow(() => { - 设备管理({{ agent.deviceCount }}) + Device Management({{ agent.deviceCount }}) diff --git a/main/manager-mobile/src/pages/settings/index.vue b/main/manager-mobile/src/pages/settings/index.vue index 41d16c00d..d7d34bba8 100644 --- a/main/manager-mobile/src/pages/settings/index.vue +++ b/main/manager-mobile/src/pages/settings/index.vue @@ -220,9 +220,9 @@ async function clearCache() { function showAbout() { uni.showModal({ title: `关于${import.meta.env.VITE_APP_TITLE}`, - content: `${import.meta.env.VITE_APP_TITLE}\n\n基于 Vue.js 3 + uni-app 构建的跨平台移动端管理应用,为小智ESP32智能硬件提供设备管理、智能体配置等功能。\n\n© 2025 xiaozhi-esp32-server`, + content: `${import.meta.env.VITE_APP_TITLE}\n\n基于 Vue.js 3 + uni-app 构建的跨平台移动端管理应用,为小智ESP32智能硬件提供Device Management、智能体配置等功能。\n\n© 2025 xiaozhi-esp32-server`, title: `关于小智智控台`, - content: `小智智控台\n\n基于 Vue.js 3 + uni-app 构建的跨平台移动端管理应用,为小智ESP32智能硬件提供设备管理、智能体配置等功能。\n\n© 2025 xiaozhi-esp32-server 0.7.5`, + content: `小智智控台\n\n基于 Vue.js 3 + uni-app 构建的跨平台移动端管理应用,为小智ESP32智能硬件提供Device Management、智能体配置等功能。\n\n© 2025 xiaozhi-esp32-server 0.7.5`, showCancel: false, confirmText: '确定', }) diff --git a/main/manager-web/src/assets/xiaozhi-logo.png b/main/manager-web/src/assets/xiaozhi-logo.png deleted file mode 100644 index 9e664970185207015dbc1daf44685c2136d7842a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13372 zcmV-CG{eh@P)&P`1=3O-TqdG z|M2wx@bv%4*#FPm|Igk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vZ<=<`4}D7u~^$T3n$J$bnIZrEDSOtqz$D9l9DG_ zNJW@2Y?xexrPBYn&dltw^7uGx&) z%yl$##%DL(-UglRt*l67O^PV8Qy86Q?3mf(?ze3@c0dVZmNNrnO)lC2#b@j2dyegu z{@eC$I<_c#4quNV#+V!Xj#po59^3jK+vd%iH*em&dGqGYn>TOXym|BHmHGiU*y#9x S2|MZl0000 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/manager-web/src/components/ChatHistoryDialog.vue b/main/manager-web/src/components/ChatHistoryDialog.vue index a784d0b87..80e0443b1 100644 --- a/main/manager-web/src/components/ChatHistoryDialog.vue +++ b/main/manager-web/src/components/ChatHistoryDialog.vue @@ -21,7 +21,7 @@ {{ message.content }}
-
{{ extractContentFromString(message.content) }} diff --git a/main/manager-web/src/components/DeviceItem.vue b/main/manager-web/src/components/DeviceItem.vue index 15cd1679e..679ffe906 100644 --- a/main/manager-web/src/components/DeviceItem.vue +++ b/main/manager-web/src/components/DeviceItem.vue @@ -14,31 +14,31 @@
- 语言模型:{{ device.llmModelName }} + Language Model: {{ device.llmModelName }}
- 音色模型:{{ device.ttsModelName }} ({{ device.ttsVoiceName }}) + Voice Model: {{ device.ttsModelName }} ({{ device.ttsVoiceName }})
-
+
- 配置角色 + Configure Role
- 声纹识别 + Voice Recognition
- 设备管理({{ device.deviceCount }}) + Devices ({{ device.deviceCount }})
- - 聊天记录 + + Chat History - 聊天记录 + Chat History
-
最近对话:{{ formattedLastConnectedTime }}
+
Last Conversation: {{ formattedLastConnectedTime }}
@@ -54,20 +54,20 @@ export default { }, computed: { formattedLastConnectedTime() { - if (!this.device.lastConnectedAt) return '暂未对话'; + if (!this.device.lastConnectedAt) return 'No conversations yet'; const lastTime = new Date(this.device.lastConnectedAt); const now = new Date(); const diffMinutes = Math.floor((now - lastTime) / (1000 * 60)); if (diffMinutes <= 1) { - return '刚刚'; + return 'Just now'; } else if (diffMinutes < 60) { - return `${diffMinutes}分钟前`; + return `${diffMinutes} minute${diffMinutes > 1 ? 's' : ''} ago`; } else if (diffMinutes < 24 * 60) { const hours = Math.floor(diffMinutes / 60); const minutes = diffMinutes % 60; - return `${hours}小时${minutes > 0 ? minutes + '分钟' : ''}前`; + return `${hours} hour${hours > 1 ? 's' : ''} ${minutes > 0 ? minutes + ' minute' + (minutes > 1 ? 's' : '') : ''} ago`; } else { return this.device.lastConnectedAt; } @@ -114,15 +114,17 @@ export default { .settings-btn { font-weight: 500; - font-size: 12px; + font-size: 11px; color: #5778ff; background: #e6ebff; width: auto; - padding: 0 12px; - height: 21px; - line-height: 21px; + padding: 0 10px; + height: 22px; + line-height: 22px; cursor: pointer; - border-radius: 14px; + border-radius: 11px; + white-space: nowrap; + display: inline-block; } .version-info { diff --git a/main/manager-web/src/components/DictDataDialog.vue b/main/manager-web/src/components/DictDataDialog.vue index effdf3494..fc7e1e41c 100644 --- a/main/manager-web/src/components/DictDataDialog.vue +++ b/main/manager-web/src/components/DictDataDialog.vue @@ -1,19 +1,19 @@ @@ -28,7 +28,7 @@ export default { }, title: { type: String, - default: '新增字典数据' + default: 'Add Dictionary Data' }, dictData: { type: Object, @@ -50,8 +50,8 @@ export default { sort: 0 }, rules: { - dictLabel: [{ required: true, message: '请输入字典标签', trigger: 'blur' }], - dictValue: [{ required: true, message: '请输入字典值', trigger: 'blur' }] + dictLabel: [{ required: true, message: 'Please enter dictionary label', trigger: 'blur' }], + dictValue: [{ required: true, message: 'Please enter dictionary value', trigger: 'blur' }] } } }, diff --git a/main/manager-web/src/components/DictTypeDialog.vue b/main/manager-web/src/components/DictTypeDialog.vue index a7b4c1db6..56d3280a3 100644 --- a/main/manager-web/src/components/DictTypeDialog.vue +++ b/main/manager-web/src/components/DictTypeDialog.vue @@ -1,16 +1,16 @@ @@ -25,7 +25,7 @@ export default { }, title: { type: String, - default: '新增字典类型' + default: 'Add Dictionary Type' }, dictTypeData: { type: Object, @@ -41,8 +41,8 @@ export default { dictType: '' }, rules: { - dictName: [{ required: true, message: '请输入字典类型名称', trigger: 'blur' }], - dictType: [{ required: true, message: '请输入字典类型编码', trigger: 'blur' }] + dictName: [{ required: true, message: 'Please enter dictionary type name', trigger: 'blur' }], + dictType: [{ required: true, message: 'Please enter dictionary type code', trigger: 'blur' }] } } }, diff --git a/main/manager-web/src/components/FunctionDialog.vue b/main/manager-web/src/components/FunctionDialog.vue index 76c69c8e7..a6ef14fb1 100644 --- a/main/manager-web/src/components/FunctionDialog.vue +++ b/main/manager-web/src/components/FunctionDialog.vue @@ -3,7 +3,7 @@
-

功能管理

+

Function Management

@@ -12,8 +12,8 @@
-

未选功能

- 全选 +

Unselected Functions

+ Select All
@@ -27,7 +27,7 @@
- +
@@ -35,8 +35,8 @@
-

已选功能

- 全选 +

Selected Functions

+ Select All
@@ -50,19 +50,19 @@
- +
-

参数配置 - {{ currentFunction.name }}

+

Parameter Configuration - {{ currentFunction.name }}

- +
@@ -77,7 +77,7 @@ @change="val => handleParamChange(currentFunction, field.key, val)" /> - @@ -95,7 +95,7 @@
-
请选择已配置的功能进行参数设置
+
Please select configured functions to set parameters
@@ -105,21 +105,21 @@
-

MCP接入点

+

MCP Access Point

- 以下是智能体的MCP接入点地址。 + Below is the MCP access point address for the agent. 如何部署MCP接入点   |   + target="_blank" class="doc-link">How to deploy MCP access point   |   如何接入MCP功能   + target="_blank" class="doc-link">How to integrate MCP functions  
@@ -128,17 +128,17 @@
-

接入点状态

+

Access Point Status

{{ - mcpStatus === 'connected' ? '已连接' : - mcpStatus === 'loading' ? '加载中...' : '未连接' + mcpStatus === 'connected' ? 'Connected' : + mcpStatus === 'loading' ? 'Loading...' : 'Not Connected' }}
@@ -148,7 +148,7 @@
- 暂无可用工具 + No tools available
@@ -156,8 +156,8 @@ @@ -264,13 +264,13 @@ export default { try { const successful = document.execCommand('copy'); if (successful) { - this.$message.success('已复制到剪贴板'); + this.$message.success('Copied to clipboard'); } else { - this.$message.error('复制失败,请手动复制'); + this.$message.error('Copy failed, please copy manually'); } } catch (err) { this.$message.error('复制失败,请手动复制'); - console.error('复制失败:', err); + console.error('Copy failed:', err); } finally { document.body.removeChild(textarea); } @@ -327,7 +327,7 @@ export default { const obj = JSON.parse(text); this.handleParamChange(this.currentFunction, key, obj); } catch { - this.$message.error(`${this.currentFunction.name}的${key}字段格式错误:JSON格式有误`); + this.$message.error(`${this.currentFunction.name} ${key} field format error: Invalid JSON format`); } }, handleFunctionClick(func) { diff --git a/main/manager-web/src/components/HeaderBar.vue b/main/manager-web/src/components/HeaderBar.vue index 9c5561c84..9683e02d3 100644 --- a/main/manager-web/src/components/HeaderBar.vue +++ b/main/manager-web/src/components/HeaderBar.vue @@ -3,8 +3,8 @@
- - + +
@@ -63,7 +63,7 @@
- @@ -71,7 +71,7 @@ - {{ userInfo.username || '加载中...' }} + {{ userInfo.username || 'Loading...' }} @@ -122,13 +122,13 @@ export default { this.checkScreenSize(); window.addEventListener('resize', this.checkScreenSize); }, - //移除事件监听器 + // Remove event listener beforeDestroy() { window.removeEventListener('resize', this.checkScreenSize); }, methods: { goHome() { - // 跳转到首页 + // Navigate to home page this.$router.push('/home') }, goUserManagement() { @@ -152,7 +152,7 @@ export default { goServerSideManagement() { this.$router.push('/server-side-management') }, - // 获取用户信息 + // Get user information fetchUserInfo() { userApi.getUserInfo(({ data }) => { this.userInfo = data.data @@ -164,46 +164,46 @@ export default { checkScreenSize() { this.isSmallScreen = window.innerWidth <= 1386; }, - // 处理搜索 + // Handle search handleSearch() { const searchValue = this.search.trim(); - // 如果搜索内容为空,触发重置事件 + // If search content is empty, trigger reset event if (!searchValue) { this.$emit('search-reset'); return; } try { - // 创建不区分大小写的正则表达式 + // Create case-insensitive regex const regex = new RegExp(searchValue, 'i'); - // 触发搜索事件,将正则表达式传递给父组件 + // Trigger search event, pass regex to parent component this.$emit('search', regex); } catch (error) { - console.error('正则表达式创建失败:', error); + console.error('Failed to create regex:', error); this.$message.error({ - message: '搜索关键词格式不正确', + message: 'Invalid search keyword format', showClose: true }); } }, - // 显示修改密码弹窗 + // Show change password dialog showChangePasswordDialog() { this.isChangePasswordDialogVisible = true; }, - // 退出登录 + // Logout async handleLogout() { try { - // 调用 Vuex 的 logout action + // Call Vuex logout action await this.logout(); this.$message.success({ - message: '退出登录成功', + message: 'Logout successful', showClose: true }); } catch (error) { - console.error('退出登录失败:', error); + console.error('Logout failed:', error); this.$message.error({ - message: '退出登录失败,请重试', + message: 'Logout failed, please try again', showClose: true }); } @@ -211,12 +211,12 @@ export default { handleUserDropdownVisibleChange(visible) { this.userDropdownVisible = visible; }, - // 监听第二个下拉菜单的可见状态变化 + // Listen to second dropdown menu visibility change handleParamDropdownVisibleChange(visible) { this.paramDropdownVisible = visible; }, - // 使用 mapActions 引入 Vuex 的 logout action + // Use mapActions to import Vuex logout action ...mapActions(['logout']) } } @@ -248,8 +248,8 @@ export default { } .logo-img { - width: 42px; - height: 42px; + width: 90px; + height: 90px; } .brand-img { diff --git a/main/manager-web/src/components/ParamDialog.vue b/main/manager-web/src/components/ParamDialog.vue index 7c126aa50..726603ab3 100644 --- a/main/manager-web/src/components/ParamDialog.vue +++ b/main/manager-web/src/components/ParamDialog.vue @@ -20,22 +20,22 @@
- - + + - - + + - - + + - - + + @@ -46,10 +46,10 @@ class="save-btn" :loading="saving" :disabled="saving"> - 保存 + Save - 取消 + Cancel
@@ -61,7 +61,7 @@ export default { props: { title: { type: String, - default: '新增参数' + default: 'Add Parameter' }, visible: { type: Boolean, @@ -83,21 +83,21 @@ export default { dialogKey: Date.now(), saving: false, valueTypeOptions: [ - { value: 'string', label: '字符串(string)' }, - { value: 'number', label: '数字(number)' }, - { value: 'boolean', label: '布尔值(boolean)' }, - { value: 'array', label: '数组(array)' }, - { value: 'json', label: 'JSON对象(json)' } + { value: 'string', label: 'String' }, + { value: 'number', label: 'Number' }, + { value: 'boolean', label: 'Boolean' }, + { value: 'array', label: 'Array' }, + { value: 'json', label: 'JSON Object' } ], rules: { paramCode: [ - { required: true, message: "请输入参数编码", trigger: "blur" } + { required: true, message: "Please enter parameter code", trigger: "blur" } ], paramValue: [ - { required: true, message: "请输入参数值", trigger: "blur" } + { required: true, message: "Please enter parameter value", trigger: "blur" } ], valueType: [ - { required: true, message: "请选择值类型", trigger: "change" } + { required: true, message: "Please select value type", trigger: "change" } ] } }; diff --git a/main/manager-web/src/components/ProviderDialog.vue b/main/manager-web/src/components/ProviderDialog.vue index db31fd167..1c98ecb04 100644 --- a/main/manager-web/src/components/ProviderDialog.vue +++ b/main/manager-web/src/components/ProviderDialog.vue @@ -146,7 +146,7 @@ export default { name: [{ required: true, message: 'Please enter provider name', trigger: 'blur' }] }, isAllFieldsSelected: false, - tableKey: 0 // 用于强制表格重新渲染 + tableKey: 0 // Used to force table re-render }; }, computed: { diff --git a/main/manager-web/src/components/VoicePrintDialog.vue b/main/manager-web/src/components/VoicePrintDialog.vue index 4253e8c4e..b968e0f44 100644 --- a/main/manager-web/src/components/VoicePrintDialog.vue +++ b/main/manager-web/src/components/VoicePrintDialog.vue @@ -12,8 +12,8 @@ - - + + {{ item.content }} @@ -24,22 +24,22 @@ - - + + - - + @@ -53,7 +53,7 @@ export default { props: { title: { type: String, - default: '添加说话人' + default: 'Add Speaker' }, visible: { type: Boolean, @@ -83,13 +83,13 @@ export default { ], rules: { introduce: [ - { required: true, message: "请输入描述", trigger: "blur" } + { required: true, message: "Please enter description", trigger: "blur" } ], sourceName: [ - { required: true, message: "请输入姓名", trigger: "blur" } + { required: true, message: "Please enter name", trigger: "blur" } ], audioId: [ - { required: true, message: "请选择音频向量", trigger: "change" } + { required: true, message: "Please select audio vector", trigger: "change" } ] } }; @@ -103,7 +103,7 @@ export default { }, playAudio(audioId) { if (this.playingAudioId === audioId) { - // 如果正在播放当前音频,则停止播放 + // If currently playing this audio, stop it if (this.audioElement) { this.audioElement.pause(); this.audioElement = null; @@ -112,17 +112,17 @@ export default { return; } - // 停止当前正在播放的音频 + // Stop currently playing audio if (this.audioElement) { this.audioElement.pause(); this.audioElement = null; } - // 先获取音频下载ID + // First get audio download ID this.playingAudioId = audioId; api.agent.getAudioId(audioId, (res) => { if (res.data && res.data.data) { - // 使用获取到的下载ID播放音频 + // Use the obtained download ID to play audio this.audioElement = new Audio(api.getServiceUrl() + `/agent/play/${res.data.data}`); this.audioElement.onended = () => { @@ -137,11 +137,11 @@ export default { submit() { this.$refs.form.validate((valid) => { if (valid) { - this.saving = true; // 开始加载 + this.saving = true; // Start loading this.$emit('submit', { form: this.form, done: () => { - this.saving = false; // 加载完成 + this.saving = false; // Loading complete } }); @@ -152,7 +152,7 @@ export default { }); }, cancel() { - this.saving = false; // 取消时重置状态 + this.saving = false; // Reset status on cancel this.$emit('cancel'); } }, diff --git a/main/manager-web/src/router/index.js b/main/manager-web/src/router/index.js index 867e6c2d9..a93330733 100644 --- a/main/manager-web/src/router/index.js +++ b/main/manager-web/src/router/index.js @@ -53,7 +53,7 @@ const routes = [ return import('../views/retrievePassword.vue') } }, - // 设备管理页面路由 + // Device Management页面路由 { path: '/device-management', name: 'DeviceManagement', @@ -73,7 +73,7 @@ const routes = [ path: '/model-config', name: 'ModelConfig', component: function () { - return import('../views/ModelConfig.vue') + return import('../views/modelConfig.vue') } }, { diff --git a/main/manager-web/src/views/DeviceManagement.vue b/main/manager-web/src/views/DeviceManagement.vue index 55f781faf..03e9a2a3c 100644 --- a/main/manager-web/src/views/DeviceManagement.vue +++ b/main/manager-web/src/views/DeviceManagement.vue @@ -3,7 +3,7 @@
-

设备管理

+

Device Management

diff --git a/main/manager-web/src/views/DictManagement.vue b/main/manager-web/src/views/DictManagement.vue index 9f6c80ac4..ba0ab8f47 100644 --- a/main/manager-web/src/views/DictManagement.vue +++ b/main/manager-web/src/views/DictManagement.vue @@ -3,13 +3,13 @@
-

字典管理

+

Dictionary Management

- - 搜索 + Search
@@ -21,22 +21,22 @@
- 新增字典类型 + Add Dictionary Type - 批量删除字典类型 + Batch Delete Dictionary Types
- - + + @@ -46,27 +46,27 @@
- + - - - - + + + + @@ -74,36 +74,36 @@ @@ -146,7 +146,7 @@ export default { selectedDictType: null, selectedDictTypes: [], // 恢复多选数组 dictTypeDialogVisible: false, - dictTypeDialogTitle: '新增字典类型', + dictTypeDialogTitle: 'Add Dictionary Type', dictTypeForm: { id: null, dictName: '', @@ -158,7 +158,7 @@ export default { dictDataLoading: false, isAllDictDataSelected: false, dictDataDialogVisible: false, - dictDataDialogTitle: '新增字典数据', + dictDataDialogTitle: 'Add Dictionary Data', dictDataForm: { id: null, dictTypeId: null, @@ -211,7 +211,7 @@ export default { return row === this.selectedDictType ? 'current-row' : '' }, showAddDictTypeDialog() { - this.dictTypeDialogTitle = '新增字典类型' + this.dictTypeDialogTitle = 'Add Dictionary Type' this.dictTypeForm = { id: null, dictName: '', @@ -220,7 +220,7 @@ export default { this.dictTypeDialogVisible = true }, editDictType(row) { - this.dictTypeDialogTitle = '编辑字典类型' + this.dictTypeDialogTitle = 'Edit Dictionary Type' this.dictTypeForm = { ...row } this.dictTypeDialogVisible = true }, @@ -228,7 +228,7 @@ export default { const api = formData.id ? dictApi.updateDictType : dictApi.addDictType api(formData, ({ data }) => { if (data.code === 0) { - this.$message.success('保存成功') + this.$message.success('Saved successfully') this.dictTypeDialogVisible = false this.loadDictTypeList() } @@ -236,19 +236,19 @@ export default { }, batchDeleteDictType() { if (this.selectedDictTypes.length === 0) { - this.$message.warning('请选择要删除的字典类型') + this.$message.warning('Please select dictionary types to delete') return } - this.$confirm('确定要删除选中的字典类型吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('Are you sure you want to delete the selected dictionary types?', 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { const ids = this.selectedDictTypes.map(item => item.id) dictApi.deleteDictType(ids, ({ data }) => { if (data.code === 0) { - this.$message.success('删除成功') + this.$message.success('Deleted successfully') this.loadDictTypeList() } }) @@ -289,7 +289,7 @@ export default { this.$message.warning('请先选择字典类型') return } - this.dictDataDialogTitle = '新增字典数据' + this.dictDataDialogTitle = 'Add Dictionary Data' this.dictDataForm = { id: null, dictTypeId: this.selectedDictType.id, @@ -300,7 +300,7 @@ export default { this.dictDataDialogVisible = true }, editDictData(row) { - this.dictDataDialogTitle = '编辑字典数据' + this.dictDataDialogTitle = 'Edit Dictionary Data' this.dictDataForm = { ...row } this.dictDataDialogVisible = true }, @@ -308,21 +308,21 @@ export default { const api = formData.id ? dictApi.updateDictData : dictApi.addDictData api(formData, ({ data }) => { if (data.code === 0) { - this.$message.success('保存成功') + this.$message.success('Saved successfully') this.dictDataDialogVisible = false this.loadDictDataList(formData.dictTypeId) } }) }, deleteDictData(row) { - this.$confirm('确定要删除该字典数据吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('Are you sure you want to delete this dictionary data?', 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { dictApi.deleteDictData([row.id], ({ data }) => { if (data.code === 0) { - this.$message.success('删除成功') + this.$message.success('Deleted successfully') this.loadDictDataList(row.dictTypeId) } }) @@ -331,19 +331,19 @@ export default { batchDeleteDictData() { const selectedRows = this.dictDataList.filter(row => row.selected) if (selectedRows.length === 0) { - this.$message.warning('请选择要删除的字典数据') + this.$message.warning('Please select dictionary data to delete') return } - this.$confirm(`确定要删除选中的${selectedRows.length}个字典数据吗?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to delete ${selectedRows.length} selected dictionary data?`, 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { const ids = selectedRows.map(item => item.id) dictApi.deleteDictData(ids, ({ data }) => { if (data.code === 0) { - this.$message.success('删除成功') + this.$message.success('Deleted successfully') this.loadDictDataList(this.selectedDictType.id) } }) diff --git a/main/manager-web/src/views/ModelConfig.vue b/main/manager-web/src/views/ModelConfig.vue index f7bcbf7fb..470fb2939 100644 --- a/main/manager-web/src/views/ModelConfig.vue +++ b/main/manager-web/src/views/ModelConfig.vue @@ -6,86 +6,86 @@

{{ modelTypeText }}

- - 搜索 + Search
- +
- + - 语言活动检测 + Voice Activity Detection - 语音识别 + Speech Recognition - 大语言模型 + Large Language Model - 视觉大模型 + Vision Language Model - 意图识别 + Intent Recognition - 语音合成 + Text-to-Speech - 记忆 + Memory - +
- - - - + + + - + - + - + - + @@ -94,32 +94,32 @@
{{ isAllSelected ? - '取消全选' : '全选' }} + 'Deselect All' : 'Select All' }} - 新增 + Add - 删除 + Delete
- + - - + + - - 共{{ total }}条记录 + + Total {{ total }} records
@@ -174,15 +174,15 @@ export default { computed: { modelTypeText() { const map = { - vad: '语言活动检测模型(VAD)', - asr: '语音识别模型(ASR)', - llm: '大语言模型(LLM)', - vllm: '视觉大模型(VLLM)', - intent: '意图识别模型(Intent)', - tts: '语音合成模型(TTS)', - memory: '记忆模型(Memory)' + vad: 'Voice Activity Detection (VAD)', + asr: 'Automatic Speech Recognition (ASR)', + llm: 'Large Language Model (LLM)', + vllm: 'Vision Language Model (VLLM)', + intent: 'Intent Recognition (Intent)', + tts: 'Text-to-Speech (TTS)', + memory: 'Memory Model' } - return map[this.activeTab] || '模型配置' + return map[this.activeTab] || 'Model Configuration' }, pageCount() { return Math.ceil(this.total / this.pageSize); @@ -223,24 +223,24 @@ export default { }, handleMenuSelect(index) { this.activeTab = index; - this.currentPage = 1; // 重置到第一页 - this.pageSize = 10; // 可选:重置每页条数 + this.currentPage = 1; // Reset to first page + this.pageSize = 10; // Optional: reset page size this.loadData(); }, handleSearch() { this.currentPage = 1; this.loadData(); }, - // 批量删除 + // Batch delete batchDelete() { if (this.selectedModels.length === 0) { - this.$message.warning('请先选择要删除的模型') + this.$message.warning('Please select models to delete') return } - this.$confirm('确定要删除选中的模型吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('Are you sure you want to delete the selected models?', 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { const deletePromises = this.selectedModels.map(model => @@ -255,19 +255,19 @@ export default { Promise.all(deletePromises).then(results => { if (results.every(Boolean)) { this.$message.success({ - message: '批量删除成功', + message: 'Batch deletion successful', showClose: true }) this.loadData() } else { this.$message.error({ - message: '部分删除失败', + message: 'Some deletions failed', showClose: true }) } }) }).catch(() => { - this.$message.info('已取消删除') + this.$message.info('Deletion cancelled') }) }, addModel() { @@ -277,11 +277,11 @@ export default { this.editModelData = JSON.parse(JSON.stringify(model)); this.editDialogVisible = true; }, - // 删除单个模型 + // Delete single model deleteModel(model) { - this.$confirm('确定要删除该模型吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('Are you sure you want to delete this model?', 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { Api.model.deleteModel( @@ -289,20 +289,20 @@ export default { ({ data }) => { if (data.code === 0) { this.$message.success({ - message: '删除成功', + message: 'Deletion successful', showClose: true }) this.loadData() } else { this.$message.error({ - message: data.msg || '删除失败', + message: data.msg || 'Deletion failed', showClose: true }) } } ) }).catch(() => { - this.$message.info('已取消删除') + this.$message.info('Deletion cancelled') }) }, handleCurrentChange(page) { @@ -317,13 +317,13 @@ export default { { modelType, provideCode, id, formData }, ({ data }) => { if (data.code === 0) { - this.$message.success('保存成功'); + this.$message.success('Saved successfully'); this.loadData(); this.editDialogVisible = false; } else { - this.$message.error(data.msg || '保存失败'); + this.$message.error(data.msg || 'Save failed'); } - done && done(); // 调用done回调关闭加载状态 + done && done(); // Call done callback to close loading state } ); }, @@ -342,7 +342,7 @@ export default { } }, - // 新增模型配置 + // Add model configuration handleAddConfirm(newModel) { const params = { modelType: this.activeTab, @@ -371,7 +371,7 @@ export default { }); }, - // 分页器 + // Pagination goFirst() { this.currentPage = 1; this.loadData(); @@ -393,9 +393,9 @@ export default { this.loadData(); }, - // 获取模型配置列表 + // Get model configuration list loadData() { - this.loading = true; // 开始加载 + this.loading = true; // Start loading const params = { modelType: this.activeTab, modelName: this.search, @@ -404,7 +404,7 @@ export default { }; Api.model.getModelList(params, ({ data }) => { - this.loading = false; // 结束加载 + this.loading = false; // End loading if (data.code === 0) { this.modelList = data.data.list; this.total = data.data.total; @@ -413,7 +413,7 @@ export default { } }); }, - // 处理启用/禁用状态变更 + // Handle enable/disable status change handleStatusChange(model) { const newStatus = model.isEnabled ? 1 : 0 const originalStatus = model.isEnabled @@ -425,13 +425,13 @@ export default { newStatus, ({ data }) => { if (data.code === 0) { - this.$message.success(newStatus === 1 ? '启用成功' : '禁用成功') - // 保持新状态 + this.$message.success(newStatus === 1 ? 'Enabled successfully' : 'Disabled successfully') + // Keep new status model.isEnabled = newStatus } else { - // 操作失败时恢复原状态 + // Restore original status on operation failure model.isEnabled = originalStatus - this.$message.error(data.msg || '操作失败') + this.$message.error(data.msg || 'Operation failed') } } ) @@ -439,7 +439,7 @@ export default { handleDefaultChange(model) { Api.model.setDefaultModel(model.id, ({ data }) => { if (data.code === 0) { - this.$message.success('设置默认模型成功') + this.$message.success('Default model set successfully') this.loadData() } }) @@ -741,7 +741,7 @@ export default { } ::v-deep .el-table .custom-selection-header .cell::before { - content: '选择'; + content: 'Select'; display: block; text-align: center; line-height: 0; @@ -808,7 +808,7 @@ export default { .voice-management-btn:hover { background: #8aa2e0; - /* 悬停时颜色加深 */ + /* Darken color on hover */ transform: scale(1.05); } @@ -831,13 +831,13 @@ export default { padding-right: 10px; } -/* 分页器 */ +/* Pagination */ .custom-pagination { display: flex; align-items: center; gap: 8px; - /* 导航按钮样式 (首页、上一页、下一页) */ + /* Navigation button styles (First, Previous, Next) */ .pagination-btn:first-child, .pagination-btn:nth-child(2), .pagination-btn:nth-child(3), @@ -863,7 +863,7 @@ export default { } } - /* 数字按钮样式 */ + /* Number button styles */ .pagination-btn:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:nth-last-child(2)) { min-width: 28px; height: 32px; diff --git a/main/manager-web/src/views/OtaManagement.vue b/main/manager-web/src/views/OtaManagement.vue index b58f70893..aedcaa67d 100644 --- a/main/manager-web/src/views/OtaManagement.vue +++ b/main/manager-web/src/views/OtaManagement.vue @@ -3,11 +3,11 @@
-

固件管理

+

Firmware Management

- - 搜索 + Search
@@ -16,44 +16,44 @@
- + - - + + - - + + - - + - + - + @@ -61,33 +61,33 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? 'Deselect All' : 'Select All' }} 新增 + style="background: #5bc98c;border: None;">Add 删除 + @click="deleteSelectedParams">Delete
- - 共{{ total }}条记录 + Total {{ total }} records
@@ -95,7 +95,7 @@
- + @@ -193,7 +193,7 @@ export default { this.paramsList = []; this.total = 0; this.$message.error({ - message: res?.data?.msg || '获取固件列表失败', + message: res?.data?.msg || 'Failed to get firmware list', showClose: true }); } @@ -222,7 +222,7 @@ export default { firmwarePath: "" }; this.$nextTick(() => { - // 重置表单的校验状态 + // Reset form validation state if (this.$refs.firmwareDialog && this.$refs.firmwareDialog.$refs.form) { this.$refs.firmwareDialog.$refs.form.clearValidate(); } @@ -236,37 +236,37 @@ export default { }, handleSubmit(form) { if (form.id) { - // 编辑 + // Edit Api.ota.updateOta(form.id, form, (res) => { res = res.data; if (res.code === 0) { this.$message.success({ - message: "修改成功", + message: "Update successful", showClose: true }); this.dialogVisible = false; this.fetchFirmwareList(); } else { this.$message.error({ - message: res.msg || "修改失败", + message: res.msg || "Update failed", showClose: true }); } }); } else { - // 新增 + // Add Api.ota.saveOta(form, (res) => { res = res.data; if (res.code === 0) { this.$message.success({ - message: "新增成功", + message: "Add successful", showClose: true }); this.dialogVisible = false; this.fetchFirmwareList(); } else { this.$message.error({ - message: res.msg || "新增失败", + message: res.msg || "Add failed", showClose: true }); } @@ -278,7 +278,7 @@ export default { const selectedRows = this.firmwareList.filter(row => row.selected); if (selectedRows.length === 0) { this.$message.warning({ - message: "请先选择需要删除的固件", + message: "Please select firmware to delete first", showClose: true }); return; @@ -286,28 +286,28 @@ export default { this.deleteParam(selectedRows); }, deleteParam(row) { - // 处理单个参数或参数数组 + // Handle single parameter or parameter array const params = Array.isArray(row) ? row : [row]; if (Array.isArray(row) && row.length === 0) { this.$message.warning({ - message: "请先选择需要删除的参数", + message: "Please select parameters to delete first", showClose: true }); return; } const paramCount = params.length; - this.$confirm(`确定要删除选中的${paramCount}个固件吗?`, '警告', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to delete ${paramCount} selected firmware?`, 'Warning', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning', distinguishCancelAndClose: true }).then(() => { const ids = params.map(param => param.id); if (ids.some(id => !id)) { this.$message.error({ - message: '存在无效的参数ID', + message: 'Invalid parameter ID exists', showClose: true }); return; @@ -317,13 +317,13 @@ export default { res = res.data; if (res.code === 0) { this.$message.success({ - message: `成功删除${paramCount}个固件`, + message: `Successfully deleted ${paramCount} firmware`, showClose: true }); this.fetchFirmwareList(); } else { this.$message.error({ - message: res.msg || '删除失败,请重试', + message: res.msg || 'Delete failed, please try again', showClose: true }); } @@ -332,13 +332,13 @@ export default { if (action === 'cancel') { this.$message({ type: 'info', - message: '已取消删除操作', + message: 'Delete operation cancelled', duration: 1000 }); } else { this.$message({ type: 'info', - message: '操作已关闭', + message: 'Operation closed', duration: 1000 }); } @@ -372,17 +372,17 @@ export default { }, downloadFirmware(firmware) { if (!firmware || !firmware.id) { - this.$message.error('固件信息不完整'); + this.$message.error('Incomplete firmware information'); return; } - // 先获取下载链接 + // First get download link Api.ota.getDownloadUrl(firmware.id, (res) => { if (res.data.code === 0) { const uuid = res.data.data; const baseUrl = process.env.VUE_APP_API_BASE_URL || ''; window.open(`${window.location.origin}${baseUrl}/otaMag/download/${uuid}`); } else { - this.$message.error('获取下载链接失败'); + this.$message.error('Failed to get download link'); } }); }, @@ -393,8 +393,8 @@ export default { const res = await Api.dict.getDictDataByType('FIRMWARE_TYPE') this.firmwareTypes = res.data } catch (error) { - console.error('获取固件类型失败:', error) - this.$message.error(error.message || '获取固件类型失败') + console.error('Failed to get firmware types:', error) + this.$message.error(error.message || 'Failed to get firmware types') } }, getFirmwareTypeName(type) { diff --git a/main/manager-web/src/views/ParamsManagement.vue b/main/manager-web/src/views/ParamsManagement.vue index 71d0866b8..9665e59d0 100644 --- a/main/manager-web/src/views/ParamsManagement.vue +++ b/main/manager-web/src/views/ParamsManagement.vue @@ -3,11 +3,11 @@
-

参数管理

+

Parameter Management

- - 搜索 + Search
@@ -16,33 +16,33 @@
- + - - + + - - + + @@ -50,32 +50,32 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? 'Deselect All' : 'Select All' }} - 新增 + Add 删除 + @click="deleteSelectedParams">Delete
- - 共{{ total }}条记录 + Total {{ total }} records
@@ -109,7 +109,7 @@ export default { pageSizeOptions: [10, 20, 50, 100], total: 0, dialogVisible: false, - dialogTitle: "新增参数", + dialogTitle: "Add Parameter", isAllSelected: false, sensitive_keys: ["api_key", "personal_access_token", "access_token", "token", "secret", "access_key_secret", "secret_key"], paramForm: { @@ -170,7 +170,7 @@ export default { this.total = data.data.total; } else { this.$message.error({ - message: data.msg || '获取参数列表失败', + message: data.msg || 'Failed to get parameter list', showClose: true }); } @@ -188,7 +188,7 @@ export default { }); }, showAddDialog() { - this.dialogTitle = "新增参数"; + this.dialogTitle = "Add Parameter"; this.paramForm = { id: null, paramCode: "", @@ -198,7 +198,7 @@ export default { this.dialogVisible = true; }, editParam(row) { - this.dialogTitle = "编辑参数"; + this.dialogTitle = "Edit Parameter"; this.paramForm = { ...row }; this.dialogVisible = true; }, @@ -209,7 +209,7 @@ export default { Api.admin.updateParam(form, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: "修改成功", + message: "Update successful", showClose: true }); this.dialogVisible = false; @@ -222,7 +222,7 @@ export default { Api.admin.addParam(form, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: "新增成功", + message: "Added successfully", showClose: true }); this.dialogVisible = false; @@ -237,7 +237,7 @@ export default { const selectedRows = this.paramsList.filter(row => row.selected); if (selectedRows.length === 0) { this.$message.warning({ - message: "请先选择需要删除的参数", + message: "Please select parameters to delete", showClose: true }); return; @@ -250,23 +250,23 @@ export default { if (Array.isArray(row) && row.length === 0) { this.$message.warning({ - message: "请先选择需要删除的参数", + message: "Please select parameters to delete", showClose: true }); return; } const paramCount = params.length; - this.$confirm(`确定要删除选中的${paramCount}个参数吗?`, '警告', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to delete ${paramCount} selected parameter(s)?`, 'Warning', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning', distinguishCancelAndClose: true }).then(() => { const ids = params.map(param => param.id); if (ids.some(id => isNaN(id))) { this.$message.error({ - message: '存在无效的参数ID', + message: 'Invalid parameter ID exists', showClose: true }); return; @@ -275,13 +275,13 @@ export default { Api.admin.deleteParam(ids, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: `成功删除${paramCount}个参数`, + message: `Successfully deleted ${paramCount} parameter(s)`, showClose: true }); this.fetchParams(); } else { this.$message.error({ - message: data.msg || '删除失败,请重试', + message: data.msg || 'Delete failed, please try again', showClose: true }); } @@ -290,13 +290,13 @@ export default { if (action === 'cancel') { this.$message({ type: 'info', - message: '已取消删除操作', + message: 'Delete operation cancelled', duration: 1000 }); } else { this.$message({ type: 'info', - message: '操作已关闭', + message: 'Operation closed', duration: 1000 }); } diff --git a/main/manager-web/src/views/ProviderManagement.vue b/main/manager-web/src/views/ProviderManagement.vue index f9b057388..d501a1317 100644 --- a/main/manager-web/src/views/ProviderManagement.vue +++ b/main/manager-web/src/views/ProviderManagement.vue @@ -7,19 +7,19 @@
- 类别筛选 {{ selectedModelTypeLabel }} - 全部 + All {{ item.label }} - - 搜索 + Search
@@ -28,24 +28,24 @@
- + - + - - - + + + - - + + @@ -84,19 +84,19 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? 'Deselect All' : 'Select All' }} - 新增 - 删除 + Add + Delete
- +
- + @@ -175,7 +175,7 @@ export default { }, computed: { selectedModelTypeLabel() { - if (!this.searchModelType) return "(全部)"; + if (!this.searchModelType) return "(All)"; const selectedType = this.modelTypes.find(item => item.value === this.searchModelType); return selectedType ? `(${selectedType.label})` : ""; }, @@ -208,7 +208,7 @@ export default { // list.sort((a, b) => a.sort - b.sort); - // // 分页处理 + // // Pagination processing // const start = (this.currentPage - 1) * this.pageSize; // return list.slice(start, start + this.pageSize); } @@ -324,9 +324,9 @@ export default { const providers = Array.isArray(row) ? row : [row]; const providerCount = providers.length; - this.$confirm(`确定要删除选中的${providerCount}个供应器吗?`, '警告', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to delete ${providerCount} selected provider(s)?`, 'Warning', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning', }).then(() => { const ids = providers.map(provider => provider.id); @@ -334,15 +334,15 @@ export default { if (data.code === 0) { this.isAllSelected = false; - this.fetchProviders(); // 刷新表格 + this.fetchProviders(); // Refresh table this.$message.success({ - message: `成功删除${providerCount}个参数`, + message: `Successfully deleted ${providerCount} provider(s)`, showClose: true }); } else { this.$message.error({ - message: data.msg || '删除失败,请重试', + message: data.msg || 'Delete failed, please try again', showClose: true }); } @@ -350,7 +350,7 @@ export default { }).catch(() => { this.$message({ type: 'info', - message: '已取消删除', + message: 'Delete cancelled', showClose: true, duration: 1000 }); diff --git a/main/manager-web/src/views/ServerSideManager.vue b/main/manager-web/src/views/ServerSideManager.vue index 973fcd6f5..bc8d8d4d3 100644 --- a/main/manager-web/src/views/ServerSideManager.vue +++ b/main/manager-web/src/views/ServerSideManager.vue @@ -3,7 +3,7 @@
-

服务端管理

+

Server Management

@@ -11,19 +11,19 @@
- + - - + + @@ -53,15 +53,15 @@ export default { actionMap: { restart: { value: 'restart', - title: "重启服务端", - message: "确定要重启服务端吗?", - confirmText: "重启", + title: "Restart Server", + message: "Are you sure you want to restart the server?", + confirmText: "Restart", }, update_config: { value: 'update_config', - title: "更新配置", - message: "确定要更新配置吗?", - confirmText: "更新", + title: "Update Configuration", + message: "Are you sure you want to update the configuration?", + confirmText: "Update", } }, currentPage: 1, @@ -70,7 +70,7 @@ export default { pageSizeOptions: [10, 20, 50, 100], total: 0, dialogVisible: false, - dialogTitle: "新增参数", + dialogTitle: "Add Parameter", isAllSelected: false, sensitive_keys: ["api_key", "personal_access_token", "access_token", "token", "secret", "access_key_secret", "secret_key"], paramForm: { @@ -122,7 +122,7 @@ export default { this.total = data.data.length; } else { this.$message.error({ - message: data.msg || '获取参数列表失败', + message: data.msg || 'Failed to get parameter list', showClose: true }); } @@ -133,24 +133,25 @@ export default { if (actionItem === undefined || rowItem.address === undefined) { return; } - // 弹开询问框 + // Show confirmation dialog this.$confirm(actionItem.message, actionItem.title, { - confirmButtonText: actionItem.confirmText, // 确认按钮文本 + confirmButtonText: actionItem.confirmText, // Confirm button text + cancelButtonText: 'Cancel' }).then(() => { - // 用户点击了确认按钮 + // User clicked confirm button Api.admin.sendWsServerAction({ targetWs: rowItem.address, action: actionItem.value }, ({ data }) => { if (data.code !== 0) { this.$message.error({ - message: data.msg || '操作失败', + message: data.msg || 'Operation failed', showClose: true }); return; } this.$message.success({ - message: `${actionItem.title}成功`, + message: `${actionItem.title} successful`, showClose: true }) }) diff --git a/main/manager-web/src/views/UserManagement.vue b/main/manager-web/src/views/UserManagement.vue index 34d60e746..15eb39862 100644 --- a/main/manager-web/src/views/UserManagement.vue +++ b/main/manager-web/src/views/UserManagement.vue @@ -3,11 +3,11 @@
-

用户管理

+

User Management

- - 搜索 + Search
@@ -16,31 +16,31 @@
- + - - - - - + + + + + - + @@ -48,32 +48,32 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? 'Deselect All' : 'Select All' }} - 启用 + Enable 禁用 - 删除 + class="el-icon-remove-outline rotated-icon">Disable + Delete
- + - 共{{ total }}条记录 + Total {{ total }} records
@@ -148,7 +148,7 @@ export default { mobile: this.searchPhone, }, ({ data }) => { - this.loading = false; // 结束加载 + this.loading = false; // End loading if (data.code === 0) { this.userList = data.data.list.map(item => ({ ...item, @@ -172,19 +172,19 @@ export default { batchDelete() { const selectedUsers = this.userList.filter(user => user.selected); if (selectedUsers.length === 0) { - this.$message.warning("请先选择需要删除的用户"); + this.$message.warning("Please select users to delete first"); return; } - this.$confirm(`确定要删除选中的${selectedUsers.length}个用户吗?`, "警告", { - confirmButtonText: "确定", - cancelButtonText: "取消", + this.$confirm(`Are you sure you want to delete ${selectedUsers.length} selected users?`, "Warning", { + confirmButtonText: "Confirm", + cancelButtonText: "Cancel", type: "warning", }) .then(async () => { const loading = this.$loading({ lock: true, - text: "正在删除中...", + text: "Deleting...", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); @@ -209,29 +209,29 @@ export default { if (failCount === 0) { this.$message.success({ - message: `成功删除${successCount}个用户`, + message: `Successfully deleted ${successCount} users`, showClose: true }); } else if (successCount === 0) { this.$message.error({ - message: '删除失败,请重试', + message: 'Delete failed, please try again', showClose: true }); } else { this.$message.warning( - `成功删除${successCount}个用户,${failCount}个删除失败` + `Successfully deleted ${successCount} users, ${failCount} failed` ); } this.fetchUsers(); } catch (error) { - this.$message.error("删除过程中发生错误"); + this.$message.error("Error occurred during deletion"); } finally { loading.close(); } }) .catch(() => { - this.$message.info("已取消删除"); + this.$message.info("Delete cancelled"); }); }, batchEnable() { @@ -243,16 +243,16 @@ export default { this.handleChangeStatus(selectedUsers, 0); }, resetPassword(row) { - this.$confirm("重置后将会生成新密码,是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", + this.$confirm("A new password will be generated after reset, continue?", "Tip", { + confirmButtonText: "Confirm", + cancelButtonText: "Cancel", }).then(() => { Api.admin.resetUserPassword(row.userid, ({ data }) => { if (data.code === 0) { this.currentPassword = data.data; this.showViewPassword = true; this.$message.success({ - message: "密码已重置,请通知用户使用新密码登录", + message: "Password has been reset, please notify the user to login with the new password", showClose: true }); } @@ -260,22 +260,22 @@ export default { }); }, deleteUser(row) { - this.$confirm("确定要删除该用户吗?", "警告", { - confirmButtonText: "确定", - cancelButtonText: "取消", + this.$confirm("Are you sure you want to delete this user?", "Warning", { + confirmButtonText: "Confirm", + cancelButtonText: "Cancel", type: "warning", }) .then(() => { Api.admin.deleteUser(row.userid, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: "删除成功", + message: "Delete successful", showClose: true }); this.fetchUsers(); } else { this.$message.error({ - message: data.msg || "删除失败", + message: data.msg || "Delete failed", showClose: true }); } @@ -304,38 +304,38 @@ export default { this.fetchUsers(); }, handleChangeStatus(row, status) { - // 处理单个用户或用户数组 + // Handle single user or user array const users = Array.isArray(row) ? row : [row]; - const confirmText = status === 0 ? '禁用' : '启用'; + const confirmText = status === 0 ? 'disable' : 'enable'; const userCount = users.length; - this.$confirm(`确定要${confirmText}选中的${userCount}个用户吗?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to ${confirmText} ${userCount} selected users?`, 'Tip', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { const userIds = users.map(user => user.userid); if (userIds.some(id => isNaN(id))) { - this.$message.error('存在无效的用户ID'); + this.$message.error('Invalid user ID exists'); return; } Api.user.changeUserStatus(status, userIds, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: `成功${confirmText}${userCount}个用户`, + message: `Successfully ${confirmText}d ${userCount} users`, showClose: true }); - this.fetchUsers(); // 刷新用户列表 + this.fetchUsers(); // Refresh user list } else { this.$message.error({ - message: '操作失败,请重试', + message: 'Operation failed, please try again', showClose: true }); } }); }).catch(() => { - // 用户取消操作 + // User cancelled operation }); }, }, diff --git a/main/manager-web/src/views/VoicePrint.vue b/main/manager-web/src/views/VoicePrint.vue index be55a9073..afa0910f5 100644 --- a/main/manager-web/src/views/VoicePrint.vue +++ b/main/manager-web/src/views/VoicePrint.vue @@ -3,7 +3,7 @@
-

声纹识别

+

Voice Recognition

@@ -11,23 +11,23 @@
- - - - + + + +
- 新增 + Add
@@ -35,7 +35,7 @@
- + @@ -56,7 +56,7 @@ export default { voicePrintList: [], loading: false, dialogVisible: false, - dialogTitle: "添加说话人", + dialogTitle: "Add Speaker", isAllSelected: false, paramForm: { id: null, @@ -87,7 +87,7 @@ export default { })); } else { this.$message.error({ - message: data.msg || '获取声纹列表失败', + message: data.msg || 'Failed to get voice print list', showClose: true }); } @@ -95,7 +95,7 @@ export default { ); }, showAddDialog() { - this.dialogTitle = "添加说话人"; + this.dialogTitle = "Add Speaker"; this.paramForm = { id: null, audioId: '', @@ -105,18 +105,18 @@ export default { this.dialogVisible = true; }, editVoicePrint(row) { - this.dialogTitle = "编辑说话人"; + this.dialogTitle = "Edit Speaker"; this.paramForm = { ...row }; this.dialogVisible = true; }, handleSubmit({ form, done }) { if (form.id) { - // 编辑 + // Edit Api.agent.updateAgentVoicePrint(form, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: "修改成功", + message: "Update successful", showClose: true }); this.dialogVisible = false; @@ -125,7 +125,7 @@ export default { done && done(); }); } else { - // 新增 + // Add Api.agent.addAgentVoicePrint({ agentId: this.agentId, audioId: form.audioId, @@ -134,7 +134,7 @@ export default { }, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: "新增成功", + message: "Add successful", showClose: true }); this.dialogVisible = false; @@ -144,24 +144,24 @@ export default { }); } }, - // 删除按钮 + // Delete button deleteVoicePrint(id) { - this.$confirm(`确定要删除选中的此声纹吗?`, '警告', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm(`Are you sure you want to delete this voice print?`, 'Warning', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning', distinguishCancelAndClose: true }).then(() => { Api.agent.deleteAgentVoicePrint(id, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: `成功删除此声纹`, + message: `Successfully deleted voice print`, showClose: true }); this.fetchVoicePrints(); } else { this.$message.error({ - message: data.msg || '删除失败,请重试', + message: data.msg || 'Delete failed, please try again', showClose: true }); } @@ -170,13 +170,13 @@ export default { if (action === 'cancel') { this.$message({ type: 'info', - message: '已取消删除操作', + message: 'Delete operation cancelled', duration: 1000 }); } else { this.$message({ type: 'info', - message: '操作已关闭', + message: 'Operation closed', duration: 1000 }); } diff --git a/main/manager-web/src/views/home.vue b/main/manager-web/src/views/home.vue index 005d763c2..15f3e06a1 100644 --- a/main/manager-web/src/views/home.vue +++ b/main/manager-web/src/views/home.vue @@ -8,12 +8,12 @@
- 你好,小智 + Hello, Cheeko
- 让我们度过 + Let's have a
- 美好的一天! + wonderful day!
@@ -21,7 +21,7 @@
- 添加智能体 + Add Agent
diff --git a/main/manager-web/src/views/login.vue b/main/manager-web/src/views/login.vue index 24c601d9c..83bc3a495 100644 --- a/main/manager-web/src/views/login.vue +++ b/main/manager-web/src/views/login.vue @@ -3,7 +3,7 @@
- +
@@ -14,7 +14,7 @@
- +
- +
- 验证码
-
新用户注册
-
忘记密码?
+
New User Registration
+
Forgot Password?
- +
- 登录即同意 -
《用户协议》
- 和 -
《隐私政策》
+ By logging in, you agree to +
User Agreement
+ and +
Privacy Policy
@@ -143,7 +143,7 @@ export default { const blob = new Blob([res.data], { type: res.data.type }); this.captchaUrl = URL.createObjectURL(blob); } else { - showDanger('验证码加载失败,点击刷新'); + showDanger('Failed to load verification code, click to refresh'); } }); } @@ -173,35 +173,35 @@ export default { if (this.isMobileLogin) { // 手机号登录验证 if (!validateMobile(this.form.mobile, this.form.areaCode)) { - showDanger('请输入正确的手机号码'); + showDanger('Please enter a valid phone number'); return; } // 拼接手机号作为用户名 this.form.username = this.form.areaCode + this.form.mobile; } else { // 用户名登录验证 - if (!this.validateInput(this.form.username, '用户名不能为空')) { + if (!this.validateInput(this.form.username, 'Username cannot be empty')) { return; } } // 验证密码 - if (!this.validateInput(this.form.password, '密码不能为空')) { + if (!this.validateInput(this.form.password, 'Password cannot be empty')) { return; } // 验证验证码 - if (!this.validateInput(this.form.captcha, '验证码不能为空')) { + if (!this.validateInput(this.form.captcha, 'Verification code cannot be empty')) { return; } this.form.captchaId = this.captchaUuid Api.user.login(this.form, ({ data }) => { - showSuccess('登录成功!'); + showSuccess('Login successful!'); this.$store.commit('setToken', JSON.stringify(data.data)); goToPage('/home'); }, (err) => { - showDanger(err.data.msg || '登录失败') - if (err.data != null && err.data.msg != null && err.data.msg.indexOf('图形验证码') > -1) { + showDanger(err.data.msg || 'Login failed') + if (err.data != null && err.data.msg != null && (err.data.msg.indexOf('verification code') > -1 || err.data.msg.indexOf('图形验证码') > -1)) { this.fetchCaptcha() } }) diff --git a/main/manager-web/src/views/register.vue b/main/manager-web/src/views/register.vue index e9f7dbcb4..5131eecdb 100644 --- a/main/manager-web/src/views/register.vue +++ b/main/manager-web/src/views/register.vue @@ -4,7 +4,7 @@
- +
diff --git a/main/manager-web/src/views/retrievePassword.vue b/main/manager-web/src/views/retrievePassword.vue index dbf3ffcfc..6abc2340c 100644 --- a/main/manager-web/src/views/retrievePassword.vue +++ b/main/manager-web/src/views/retrievePassword.vue @@ -4,7 +4,7 @@
- +
diff --git a/main/manager-web/src/views/roleConfig.vue b/main/manager-web/src/views/roleConfig.vue index bbba01bda..a12b45c5f 100644 --- a/main/manager-web/src/views/roleConfig.vue +++ b/main/manager-web/src/views/roleConfig.vue @@ -3,7 +3,7 @@
-

角色配置

+

Role Configuration

@@ -18,10 +18,10 @@
- 保存配置后,需要重启设备,新的配置才会生效。 + After saving the configuration, you need to restart the device for the new configuration to take effect.
- 保存配置 - 重置 + Save Configuration + Reset @@ -33,10 +33,10 @@
- + - +
@@ -44,39 +44,39 @@
- - + - + - - + - - +
- +
-
- +
- @@ -87,7 +87,7 @@
- @@ -96,7 +96,7 @@
-
功能名称: {{ func.name }}
+
Function Name: {{ func.name }}
{{ func.name.charAt(0) }} @@ -104,20 +104,20 @@ - 编辑功能 + Edit Functions
- 上报文字 - 上报文字+语音 + Report Text + Report Text + Audio
- - + + @@ -166,13 +166,13 @@ export default { } }, models: [ - { label: '语音活动检测(VAD)', key: 'vadModelId', type: 'VAD' }, - { label: '语音识别(ASR)', key: 'asrModelId', type: 'ASR' }, - { label: '大语言模型(LLM)', key: 'llmModelId', type: 'LLM' }, - { label: '视觉大模型(VLLM)', key: 'vllmModelId', type: 'VLLM' }, - { label: '意图识别(Intent)', key: 'intentModelId', type: 'Intent' }, - { label: '记忆(Memory)', key: 'memModelId', type: 'Memory' }, - { label: '语音合成(TTS)', key: 'ttsModelId', type: 'TTS' } + { label: 'Voice Activity Detection (VAD)', key: 'vadModelId', type: 'VAD' }, + { label: 'Speech Recognition (ASR)', key: 'asrModelId', type: 'ASR' }, + { label: 'Large Language Model (LLM)', key: 'llmModelId', type: 'LLM' }, + { label: 'Vision Language Model (VLLM)', key: 'vllmModelId', type: 'VLLM' }, + { label: 'Intent Recognition (Intent)', key: 'intentModelId', type: 'Intent' }, + { label: 'Memory', key: 'memModelId', type: 'Memory' }, + { label: 'Text-to-Speech (TTS)', key: 'ttsModelId', type: 'TTS' } ], llmModeTypeMap: new Map(), modelOptions: {}, @@ -221,21 +221,21 @@ export default { Api.agent.updateAgentConfig(this.$route.query.agentId, configData, ({ data }) => { if (data.code === 0) { this.$message.success({ - message: '配置保存成功', + message: 'Configuration saved successfully', showClose: true }); } else { this.$message.error({ - message: data.msg || '配置保存失败', + message: data.msg || 'Failed to save configuration', showClose: true }); } }); }, resetConfig() { - this.$confirm('确定要重置配置吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('Are you sure you want to reset the configuration?', 'Confirm', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { this.form = { @@ -260,7 +260,7 @@ export default { } this.currentFunctions = []; this.$message.success({ - message: '配置已重置', + message: 'Configuration has been reset', showClose: true }) }).catch(() => { @@ -271,7 +271,7 @@ export default { if (data.code === 0) { this.templates = data.data; } else { - this.$message.error(data.msg || '获取模板列表失败'); + this.$message.error(data.msg || 'Failed to get template list'); } }); }, @@ -361,7 +361,7 @@ export default { this.updateIntentOptionsVisibility(); }); } else { - this.$message.error(data.msg || '获取配置失败'); + this.$message.error(data.msg || 'Failed to get configuration'); } }); }, @@ -381,7 +381,7 @@ export default { this.updateIntentOptionsVisibility(); } } else { - this.$message.error(data.msg || '获取模型列表失败'); + this.$message.error(data.msg || 'Failed to get model list'); } }); } else { @@ -398,7 +398,7 @@ export default { }) this.$set(this.modelOptions, model.type, LLMdata); } else { - this.$message.error(data.msg || '获取LLM模型列表失败'); + this.$message.error(data.msg || 'Failed to get LLM model list'); } }); } @@ -457,7 +457,7 @@ export default { }); resolve(); } else { - this.$message.error(data.msg || '获取插件列表失败'); + this.$message.error(data.msg || 'Failed to get plugin list'); reject(); } }); diff --git a/main/xiaozhi-server/check_edge_voices.py b/main/xiaozhi-server/check_edge_voices.py new file mode 100644 index 000000000..a72609f09 --- /dev/null +++ b/main/xiaozhi-server/check_edge_voices.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import json +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + # Check EdgeTTS voices + print("=" * 60) + print("Current EdgeTTS Voices in Database:") + print("=" * 60) + + # First, find the EdgeTTS model ID + cursor.execute(""" + SELECT id, model_name + FROM ai_model_config + WHERE model_name LIKE '%Edge%' AND model_type = 'tts' + """) + edge_model = cursor.fetchone() + + if edge_model: + print(f"EdgeTTS Model: {edge_model[1]} (ID: {edge_model[0]})") + + # Now get all voices for EdgeTTS + cursor.execute(""" + SELECT id, name, tts_voice, languages, remark + FROM ai_tts_voice + WHERE tts_model_id = %s + ORDER BY name + """, (edge_model[0],)) + + voices = cursor.fetchall() + + print(f"\nFound {len(voices)} EdgeTTS voices:") + print("-" * 60) + + for voice in voices: + print(f"ID: {voice[0]}") + print(f" Name: {voice[1]}") + print(f" TTS Voice: {voice[2]}") + print(f" Languages: {voice[3]}") + if voice[4]: + print(f" Remark: {voice[4]}") + print() + + # Translate Chinese voice names to English + print("=" * 60) + print("Translating Chinese voice names to English...") + print("=" * 60) + + # Common EdgeTTS voice translations (preserving the actual voice IDs) + voice_translations = [ + # Female voices + ("EdgeTTS女声-晓晓", "EdgeTTS Female - Xiaoxiao"), + ("EdgeTTS女声-晓伊", "EdgeTTS Female - Xiaoyi"), + ("EdgeTTS女声-晓双", "EdgeTTS Female - Xiaoshuang"), + ("EdgeTTS女声-晓萱", "EdgeTTS Female - Xiaoxuan"), + ("EdgeTTS女声-晓颜", "EdgeTTS Female - Xiaoyan"), + ("EdgeTTS女声-晓悠", "EdgeTTS Female - Xiaoyou"), + ("EdgeTTS女声-云夏", "EdgeTTS Female - Yunxia"), + ("EdgeTTS女声-云燕", "EdgeTTS Female - Yunyan"), + + # Male voices + ("EdgeTTS男声-云健", "EdgeTTS Male - Yunjian"), + ("EdgeTTS男声-云泽", "EdgeTTS Male - Yunze"), + ("EdgeTTS男声-云希", "EdgeTTS Male - Yunxi"), + ("EdgeTTS男声-云扬", "EdgeTTS Male - Yunyang"), + ("EdgeTTS男声-晓辰", "EdgeTTS Male - Xiaochen"), + + # English voices (if any have Chinese labels) + ("EdgeTTS女声-Jenny", "EdgeTTS Female - Jenny"), + ("EdgeTTS女声-Aria", "EdgeTTS Female - Aria"), + ("EdgeTTS男声-Guy", "EdgeTTS Male - Guy"), + ("EdgeTTS男声-Davis", "EdgeTTS Male - Davis"), + + # Generic translations + ("女声", "Female"), + ("男声", "Male"), + ("儿童声", "Child"), + ("中文", "Chinese"), + ("英文", "English"), + ] + + updated_count = 0 + for old_name, new_name in voice_translations: + cursor.execute(""" + UPDATE ai_tts_voice + SET name = %s + WHERE name = %s AND tts_model_id = %s + """, (new_name, old_name, edge_model[0])) + + if cursor.rowcount > 0: + print(f"✓ Updated: '{old_name}' → '{new_name}'") + updated_count += cursor.rowcount + + # Also update any remaining Chinese characters in voice names + cursor.execute(""" + SELECT id, name + FROM ai_tts_voice + WHERE tts_model_id = %s + AND (name LIKE '%女%' OR name LIKE '%男%' OR name LIKE '%声%' OR name LIKE '%中文%' OR name LIKE '%英文%') + """, (edge_model[0],)) + + remaining_chinese = cursor.fetchall() + if remaining_chinese: + print("\nUpdating remaining Chinese characters in voice names:") + for voice_id, voice_name in remaining_chinese: + new_name = voice_name + new_name = new_name.replace("女声", "Female") + new_name = new_name.replace("男声", "Male") + new_name = new_name.replace("儿童声", "Child") + new_name = new_name.replace("中文", "Chinese") + new_name = new_name.replace("英文", "English") + new_name = new_name.replace("语音", "Voice") + + if new_name != voice_name: + cursor.execute(""" + UPDATE ai_tts_voice + SET name = %s + WHERE id = %s + """, (new_name, voice_id)) + print(f"✓ Updated: '{voice_name}' → '{new_name}'") + updated_count += 1 + + connection.commit() + + if updated_count > 0: + print(f"\n✅ Successfully updated {updated_count} voice names!") + else: + print("\n⚠️ No voice names needed updating.") + + # Show final results + print("\n" + "=" * 60) + print("Updated EdgeTTS Voices:") + print("=" * 60) + + cursor.execute(""" + SELECT id, name, tts_voice, languages + FROM ai_tts_voice + WHERE tts_model_id = %s + ORDER BY name + """, (edge_model[0],)) + + for voice in cursor.fetchall(): + print(f"Name: {voice[1]} | Voice ID: {voice[2]} | Lang: {voice[3]}") + else: + print("EdgeTTS model not found in database!") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/check_tables.py b/main/xiaozhi-server/check_tables.py new file mode 100644 index 000000000..70e49bff3 --- /dev/null +++ b/main/xiaozhi-server/check_tables.py @@ -0,0 +1,41 @@ +import pymysql + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + # Show all tables + cursor.execute("SHOW TABLES") + tables = cursor.fetchall() + + print("=" * 60) + print("Tables in Railway database:") + print("=" * 60) + for table in tables: + print(f"- {table[0]}") + + # Check for model-related tables + print("\n" + "=" * 60) + print("Checking model/config related tables:") + print("=" * 60) + + for table in tables: + table_name = table[0] + if 'model' in table_name.lower() or 'config' in table_name.lower() or 'tts' in table_name.lower(): + cursor.execute(f"DESCRIBE {table_name}") + columns = cursor.fetchall() + print(f"\nTable: {table_name}") + print("Columns:") + for col in columns: + print(f" - {col[0]} ({col[1]})") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/check_tts_models.py b/main/xiaozhi-server/check_tts_models.py new file mode 100644 index 000000000..0f919ec80 --- /dev/null +++ b/main/xiaozhi-server/check_tts_models.py @@ -0,0 +1,76 @@ +import pymysql +import json + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + # Check TTS models + print("=" * 60) + print("TTS Models in Database:") + print("=" * 60) + + sql = """ + SELECT id, model_name, model_type, config_json + FROM model_config + WHERE model_type = 'tts' OR model_name LIKE '%Edge%' OR model_name LIKE '%语音%' + ORDER BY model_name + """ + cursor.execute(sql) + results = cursor.fetchall() + + for row in results: + print(f"\nID: {row[0]}") + print(f"Model Name: {row[1]}") + print(f"Model Type: {row[2]}") + if row[3]: + config = json.loads(row[3]) + print(f"Config Type: {config.get('type', 'N/A')}") + + # Update the Chinese text to English + print("\n" + "=" * 60) + print("Updating Chinese model names to English...") + print("=" * 60) + + updates = [ + ("Edge语音合成", "Edge TTS"), + ("百度语音合成", "Baidu TTS"), + ("阿里语音合成", "Ali TTS"), + ("腾讯语音合成", "Tencent TTS"), + ("科大讯飞语音合成", "iFlytek TTS") + ] + + for old_name, new_name in updates: + sql = "UPDATE model_config SET model_name = %s WHERE model_name = %s" + cursor.execute(sql, (new_name, old_name)) + if cursor.rowcount > 0: + print(f"✓ Updated: '{old_name}' → '{new_name}'") + + connection.commit() + print("\n✅ All TTS model names have been updated to English!") + + # Verify the changes + print("\n" + "=" * 60) + print("Updated TTS Models:") + print("=" * 60) + + cursor.execute(""" + SELECT id, model_name + FROM model_config + WHERE model_type = 'tts' + ORDER BY model_name + """) + + for row in cursor.fetchall(): + print(f"ID: {row[0]}, Name: {row[1]}") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/client.py b/main/xiaozhi-server/client.py index 784acf2da..9991684fc 100644 --- a/main/xiaozhi-server/client.py +++ b/main/xiaozhi-server/client.py @@ -19,9 +19,9 @@ import opuslib # --- Configuration --- -SERVER_IP = "192.168.1.4" # !!! UPDATE with your server's local IP address !!! -OTA_PORT = 8003 -MQTT_BROKER_HOST = "192.168.1.4" # MQTT gateway IP +SERVER_IP = "192.168.1.105" # !!! UPDATE with your server's local IP address !!! +OTA_PORT = 8002 +MQTT_BROKER_HOST = "192.168.1.105" # MQTT gateway IP MQTT_BROKER_PORT = 1883 diff --git a/main/xiaozhi-server/complete_params_translation.py b/main/xiaozhi-server/complete_params_translation.py new file mode 100644 index 000000000..c666ba12a --- /dev/null +++ b/main/xiaozhi-server/complete_params_translation.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Complete Parameter Remark Translation:") + print("=" * 60) + + # Direct mapping for each parameter's remark + remark_translations = { + "aliyun.sms.access_key_id": "Aliyun platform access key", + "aliyun.sms.access_key_secret": "Aliyun platform access key secret", + "aliyun.sms.sign_name": "Aliyun SMS signature", + "aliyun.sms.sms_code_template_code": "Aliyun SMS template code", + "close_connection_no_voice_time": "Disconnect time without voice input (seconds)", + "delete_audio": "Delete audio files after use", + "device_max_output_size": "Maximum output characters per device per day, 0 means unlimited", + "enable_greeting": "Enable greeting reply", + "enable_stop_tts_notify": "Enable end notification sound", + "enable_wakeup_words_response_cache": "Enable wake word acceleration cache", + "end_prompt.enable": "Enable ending prompt", + "end_prompt.prompt": "Ending prompt text", + "exit_commands": "Exit command list", + "log.data_dir": "Data directory", + "log.log_dir": "Log directory", + "log.log_file": "Log file name", + "log.log_format": "Console log format", + "log.log_format_file": "File log format", + "log.log_level": "Log level", + "server.allow_user_register": "Allow non-admin user registration", + "server.beian_ga_num": "Public security registration number, set null to disable", + "server.beian_icp_num": "ICP registration number, set null to disable", + "server.enable_mobile_register": "Enable mobile phone registration", + "server.fronted_url": "Dashboard URL displayed when sending 6-digit verification code", + "server.mcp_endpoint": "MCP endpoint address", + "server.name": "System name", + "server.ota": "OTA address", + "server.secret": "Server secret key", + "server.sms_max_send_count": "Maximum SMS sends per phone number per day", + "server.voice_print": "Voice print interface address", + "server.websocket": "WebSocket address, separate multiple with semicolon", + "stop_tts_notify_voice": "End notification sound file path", + "tts_timeout": "TTS request timeout (seconds)", + "wakeup_words": "Wake word list for recognition", + "xiaozhi": "Xiaozhi type configuration" + } + + total_updated = 0 + + # Update each parameter's remark + for param_code, english_remark in remark_translations.items(): + cursor.execute(""" + UPDATE sys_params + SET remark = %s + WHERE param_code = %s + """, (english_remark, param_code)) + + if cursor.rowcount > 0: + print(f"✓ Updated: {param_code}") + print(f" New remark: {english_remark}") + total_updated += 1 + + connection.commit() + + print(f"\n✅ Successfully updated {total_updated} parameter remarks!") + + # Show final results + print("\n" + "=" * 60) + print("All Parameter Remarks (Final):") + print("=" * 60) + + cursor.execute(""" + SELECT param_code, remark + FROM sys_params + ORDER BY param_code + """) + + for param_code, remark in cursor.fetchall(): + print(f"{param_code:<40} : {remark or 'No remark'}") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/config/config_loader.py b/main/xiaozhi-server/config/config_loader.py index fc72dd10d..63000fba6 100644 --- a/main/xiaozhi-server/config/config_loader.py +++ b/main/xiaozhi-server/config/config_loader.py @@ -66,15 +66,31 @@ def get_config_from_api(config): "secret": config["manager-api"].get("secret", ""), } - # Use local server configuration as priority + # Merge local server configuration with API configuration + # Local config takes priority for network settings, but preserve API settings for other fields if config.get("server"): - config_data["server"] = { - "ip": config["server"].get("ip", ""), - "port": config["server"].get("port", ""), - "http_port": config["server"].get("http_port", ""), + # Start with API server config if it exists + server_config = config_data.get("server", {}) + + # Override only specific local settings + server_config.update({ + "ip": config["server"].get("ip", "0.0.0.0"), + "port": config["server"].get("port", 8000), + "http_port": config["server"].get("http_port", 8003), "vision_explain": config["server"].get("vision_explain", ""), - "auth_key": config["server"].get("auth_key", ""), - } + }) + + # Preserve auth_key from API if not in local config + if config["server"].get("auth_key"): + server_config["auth_key"] = config["server"]["auth_key"] + elif "auth_key" not in server_config: + server_config["auth_key"] = "" + + # Add mqtt_gateway if present in local config + if "mqtt_gateway" in config["server"]: + server_config["mqtt_gateway"] = config["server"]["mqtt_gateway"] + + config_data["server"] = server_config print("FINAL MERGED CONFIGURATION:") print("=" * 80) diff --git a/main/xiaozhi-server/core/api/ota_handler.py b/main/xiaozhi-server/core/api/ota_handler.py index ff56f7e07..cbabbdd30 100644 --- a/main/xiaozhi-server/core/api/ota_handler.py +++ b/main/xiaozhi-server/core/api/ota_handler.py @@ -38,11 +38,17 @@ class OTAHandler(BaseHandler): """ server_config = self.config["server"] websocket_config = server_config.get("websocket", "") + + # Debug logging + print(f"[OTA DEBUG] server_config websocket value: {websocket_config}") + print(f"[OTA DEBUG] Full server config: {server_config}") - if "你的" not in websocket_config: - return websocket_config - else: + if not websocket_config or "你的" in websocket_config: + print(f"[OTA DEBUG] Using default websocket URL") return f"ws://{local_ip}:{port}/xiaozhi/v1/" + else: + print(f"[OTA DEBUG] Using configured websocket URL: {websocket_config}") + return websocket_config def _generate_mqtt_credentials(self, device_id: str, client_ip: str) -> dict: """Generate MQTT credentials diff --git a/main/xiaozhi-server/final_language_update.py b/main/xiaozhi-server/final_language_update.py new file mode 100644 index 000000000..ca96721a2 --- /dev/null +++ b/main/xiaozhi-server/final_language_update.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Final Language Updates:") + print("=" * 60) + + # More comprehensive language updates + language_updates = [ + ("美式英语", "US English"), + ("英式英语", "UK English"), + ("澳洲英语", "AU English"), + ("中文", "Chinese"), + ("中文-北京口音", "Chinese-Beijing"), + ("中文-四川口音", "Chinese-Sichuan"), + ("中文-长沙口音", "Chinese-Changsha"), + ("中文-广东口音", "Chinese-Guangdong"), + ("中文-广西口音", "Chinese-Guangxi"), + ("中文-青岛口音", "Chinese-Qingdao"), + ("中文-台湾口音", "Chinese-Taiwan"), + ("中文-河南口音", "Chinese-Henan"), + ("中文、美式英语", "Chinese, US English"), + ("中文-北京口音、英文", "Chinese-Beijing, EN"), + ("日语、西语", "Japanese, Spanish"), + ] + + total_updated = 0 + for old_lang, new_lang in language_updates: + # Check column length limit (50 chars for languages column) + if len(new_lang) <= 50: + cursor.execute(""" + UPDATE ai_tts_voice + SET languages = %s + WHERE languages = %s + """, (new_lang, old_lang)) + + if cursor.rowcount > 0: + print(f"✓ Updated {cursor.rowcount} voices: '{old_lang}' → '{new_lang}'") + total_updated += cursor.rowcount + + connection.commit() + + print(f"\n✅ Total updates: {total_updated} language entries!") + + # Show EdgeTTS voices specifically + print("\n" + "=" * 60) + print("EdgeTTS Voices (Final):") + print("=" * 60) + + cursor.execute(""" + SELECT v.name, v.tts_voice, v.languages + FROM ai_tts_voice v + JOIN ai_model_config m ON v.tts_model_id = m.id + WHERE m.model_name = 'EdgeTTS' + ORDER BY v.name + """) + + voices = cursor.fetchall() + + print(f"{'Name':<20} {'Voice ID':<35} {'Language':<20}") + print("-" * 75) + for voice in voices: + print(f"{voice[0]:<20} {voice[1]:<35} {voice[2] or 'N/A':<20}") + + print(f"\n✅ EdgeTTS voices are ready! The voice IDs (like zh-CN-XiaoxiaoNeural) remain unchanged.") + print("✅ EdgeTTS will continue to work properly with these English display names.") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/fix_groq_model_id.py b/main/xiaozhi-server/fix_groq_model_id.py new file mode 100644 index 000000000..1f17f069d --- /dev/null +++ b/main/xiaozhi-server/fix_groq_model_id.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Fixing Groq Model ID:") + print("=" * 60) + + # First check current status + cursor.execute(""" + SELECT id, model_name, model_type + FROM ai_model_config + WHERE id = 'GroqLLM' OR id = 'Groq LLM' OR model_name LIKE '%Groq%' + """) + + current_model = cursor.fetchall() + print("Current Groq Model:") + for model in current_model: + print(f" ID: {model[0]}, Name: {model[1]}, Type: {model[2]}") + + # Update the model ID from GroqLLM to Groq LLM + print("\nUpdating model ID from 'GroqLLM' to 'Groq LLM'...") + + cursor.execute(""" + UPDATE ai_model_config + SET id = 'Groq LLM' + WHERE id = 'GroqLLM' + """) + + if cursor.rowcount > 0: + print(f"✓ Updated model ID: 'GroqLLM' → 'Groq LLM'") + + # Also update any agent references + cursor.execute(""" + UPDATE ai_agent + SET llm_model_id = 'Groq LLM' + WHERE llm_model_id = 'GroqLLM' + """) + + if cursor.rowcount > 0: + print(f"✓ Updated {cursor.rowcount} agent references: 'GroqLLM' → 'Groq LLM'") + + connection.commit() + + # Verify the changes + print("\n" + "=" * 60) + print("Verification:") + print("=" * 60) + + cursor.execute(""" + SELECT id, model_name, model_type + FROM ai_model_config + WHERE id = 'Groq LLM' OR model_name LIKE '%Groq%' + """) + + updated_model = cursor.fetchall() + print("Updated Groq Model:") + for model in updated_model: + print(f" ID: {model[0]}, Name: {model[1]}, Type: {model[2]}") + + # Check agents using this model + cursor.execute(""" + SELECT agent_name, llm_model_id + FROM ai_agent + WHERE llm_model_id = 'Groq LLM' + """) + + agents = cursor.fetchall() + if agents: + print(f"\nAgents using Groq LLM ({len(agents)} total):") + for agent in agents: + print(f" - {agent[0]}: {agent[1]}") + + print("\n✅ Model ID successfully changed to 'Groq LLM'") + print("✅ The Manager API should now work without errors") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/fix_model_ids.py b/main/xiaozhi-server/fix_model_ids.py new file mode 100644 index 000000000..ba192e521 --- /dev/null +++ b/main/xiaozhi-server/fix_model_ids.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys +import json + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Checking Model ID Issues:") + print("=" * 60) + + # First, check the GroqLLM model + cursor.execute(""" + SELECT id, model_name, model_type + FROM ai_model_config + WHERE id = 'GroqLLM' OR model_name = 'Groq LLM' OR model_name = 'GroqLLM' + """) + + groq_model = cursor.fetchall() + print("Groq Model Status:") + for model in groq_model: + print(f" ID: {model[0]}, Name: {model[1]}, Type: {model[2]}") + + # Check agents that might be using wrong model IDs + print("\n" + "=" * 60) + print("Checking Agent Configurations:") + print("=" * 60) + + cursor.execute(""" + SELECT id, agent_name, llm_model_id, tts_model_id, asr_model_id + FROM ai_agent + WHERE llm_model_id = 'Groq LLM' + OR llm_model_id = 'GroqLLM' + OR llm_model_id LIKE '%Groq%' + """) + + agents = cursor.fetchall() + if agents: + print(f"Found {len(agents)} agents with Groq LLM:") + for agent in agents: + print(f" Agent: {agent[1]} (ID: {agent[0]})") + print(f" LLM Model ID: {agent[2]}") + + # Fix the issue - update agents with wrong model IDs + print("\n" + "=" * 60) + print("Fixing Model ID References:") + print("=" * 60) + + # Update agents that have "Groq LLM" as model ID to use "GroqLLM" + cursor.execute(""" + UPDATE ai_agent + SET llm_model_id = 'GroqLLM' + WHERE llm_model_id = 'Groq LLM' + """) + + if cursor.rowcount > 0: + print(f"✓ Fixed {cursor.rowcount} agents with incorrect LLM model ID") + + # Also check and fix any other model ID mismatches + model_id_fixes = [ + ('Groq LLM', 'GroqLLM'), + ('EdgeTTS', 'TTS_EdgeTTS'), + ('Deepgram Speech Recognition', 'Deepgram'), + # Add more mappings if needed + ] + + for old_id, new_id in model_id_fixes: + # Fix LLM model IDs + cursor.execute(""" + UPDATE ai_agent + SET llm_model_id = %s + WHERE llm_model_id = %s + """, (new_id, old_id)) + + if cursor.rowcount > 0: + print(f"✓ Fixed {cursor.rowcount} agents: LLM '{old_id}' → '{new_id}'") + + # Fix TTS model IDs + cursor.execute(""" + UPDATE ai_agent + SET tts_model_id = %s + WHERE tts_model_id = %s + """, (new_id, old_id)) + + if cursor.rowcount > 0: + print(f"✓ Fixed {cursor.rowcount} agents: TTS '{old_id}' → '{new_id}'") + + # Fix ASR model IDs + cursor.execute(""" + UPDATE ai_agent + SET asr_model_id = %s + WHERE asr_model_id = %s + """, (new_id, old_id)) + + if cursor.rowcount > 0: + print(f"✓ Fixed {cursor.rowcount} agents: ASR '{old_id}' → '{new_id}'") + + connection.commit() + + # Verify the fix + print("\n" + "=" * 60) + print("Verification - Agents using Groq:") + print("=" * 60) + + cursor.execute(""" + SELECT a.agent_name, a.llm_model_id, m.model_name + FROM ai_agent a + LEFT JOIN ai_model_config m ON a.llm_model_id = m.id + WHERE a.llm_model_id LIKE '%Groq%' OR m.model_name LIKE '%Groq%' + """) + + results = cursor.fetchall() + if results: + for result in results: + print(f"Agent: {result[0]}") + print(f" LLM Model ID: {result[1]}") + print(f" Model Name: {result[2] or 'NOT FOUND'}") + else: + print("No agents using Groq models found.") + + # Check all model configs to ensure IDs match + print("\n" + "=" * 60) + print("All Model Configurations:") + print("=" * 60) + + cursor.execute(""" + SELECT id, model_name, model_type + FROM ai_model_config + WHERE model_type = 'LLM' + ORDER BY model_name + """) + + print(f"{'ID':<30} {'Name':<30} {'Type':<10}") + print("-" * 70) + for model in cursor.fetchall(): + print(f"{model[0]:<30} {model[1]:<30} {model[2]:<10}") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/translate_params_remarks.py b/main/xiaozhi-server/translate_params_remarks.py new file mode 100644 index 000000000..b5963eda3 --- /dev/null +++ b/main/xiaozhi-server/translate_params_remarks.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Current Parameter Remarks in Database:") + print("=" * 60) + + # Get all parameters with their remarks + cursor.execute(""" + SELECT id, param_code, param_value, remark + FROM sys_params + ORDER BY param_code + """) + + params = cursor.fetchall() + + print(f"Found {len(params)} parameters:") + print("-" * 60) + + for param in params: + if param[3]: # If remark exists + print(f"Code: {param[1]}") + print(f" Remark: {param[3]}") + + print("\n" + "=" * 60) + print("Translating Chinese Remarks to English:") + print("=" * 60) + + # Translation mappings for common parameter remarks + translations = [ + # System parameters + ("是否允许用户注册", "Allow user registration"), + ("允许用户注册", "Allow user registration"), + ("是否启用手机号注册", "Enable mobile phone registration"), + ("启用手机号注册", "Enable mobile phone registration"), + ("系统公告", "System announcement"), + ("系统版本", "System version"), + ("系统名称", "System name"), + ("系统描述", "System description"), + ("系统邮箱", "System email"), + ("系统电话", "System phone"), + ("系统地址", "System address"), + ("系统备案号", "System ICP number"), + ("版权信息", "Copyright information"), + + # Security parameters + ("密码最小长度", "Minimum password length"), + ("密码最大长度", "Maximum password length"), + ("密码复杂度要求", "Password complexity requirements"), + ("登录失败次数限制", "Login failure limit"), + ("账户锁定时长", "Account lock duration"), + ("会话超时时间", "Session timeout period"), + ("验证码有效期", "Verification code validity period"), + ("刷新令牌有效期", "Refresh token validity period"), + ("访问令牌有效期", "Access token validity period"), + + # Email/SMS configuration + ("邮件服务器地址", "Email server address"), + ("邮件服务器端口", "Email server port"), + ("邮件发送者", "Email sender"), + ("邮件密码", "Email password"), + ("短信服务商", "SMS service provider"), + ("短信API密钥", "SMS API key"), + ("短信签名", "SMS signature"), + ("短信模板", "SMS template"), + + # File upload + ("文件上传大小限制", "File upload size limit"), + ("允许上传的文件类型", "Allowed file types for upload"), + ("文件存储路径", "File storage path"), + ("图片压缩质量", "Image compression quality"), + + # API configuration + ("API请求限制", "API request limit"), + ("API密钥", "API key"), + ("API密钥有效期", "API key validity period"), + ("接口调用频率限制", "API call frequency limit"), + ("接口超时时间", "API timeout period"), + + # Database configuration + ("数据库备份路径", "Database backup path"), + ("数据库备份周期", "Database backup cycle"), + ("数据保留天数", "Data retention days"), + + # Common terms + ("启用", "Enable"), + ("禁用", "Disable"), + ("开启", "Turn on"), + ("关闭", "Turn off"), + ("默认值", "Default value"), + ("配置项", "Configuration item"), + ("参数设置", "Parameter setting"), + ("系统配置", "System configuration"), + ("基础设置", "Basic settings"), + ("高级设置", "Advanced settings"), + + # Feature flags + ("功能开关", "Feature toggle"), + ("实验性功能", "Experimental feature"), + ("调试模式", "Debug mode"), + ("开发模式", "Development mode"), + ("生产模式", "Production mode"), + + # Limits and thresholds + ("最大连接数", "Maximum connections"), + ("最小连接数", "Minimum connections"), + ("连接超时", "Connection timeout"), + ("请求超时", "Request timeout"), + ("重试次数", "Retry count"), + ("重试间隔", "Retry interval"), + + # Other common terms + ("备注", "Remark"), + ("说明", "Description"), + ("注意事项", "Notes"), + ("提示", "Hint"), + ("警告", "Warning"), + ("错误", "Error"), + ("成功", "Success"), + ("失败", "Failure"), + ("状态", "Status"), + ("类型", "Type"), + ("分类", "Category"), + ("标签", "Tag"), + ("优先级", "Priority"), + ("排序", "Sort order"), + ("序号", "Serial number"), + ("编号", "Number"), + ("代码", "Code"), + ("名称", "Name"), + ("标题", "Title"), + ("内容", "Content"), + ("详情", "Details"), + ("摘要", "Summary"), + ("创建时间", "Create time"), + ("更新时间", "Update time"), + ("创建人", "Creator"), + ("更新人", "Updater"), + ("操作人", "Operator"), + ("负责人", "Person in charge"), + ("联系人", "Contact person"), + ("联系方式", "Contact information"), + ] + + total_updated = 0 + + # Update each parameter's remark + for param_id, param_code, param_value, remark in params: + if remark: + new_remark = remark + # Apply translations + for chinese, english in translations: + if chinese in new_remark: + new_remark = new_remark.replace(chinese, english) + + # If remark was changed, update it + if new_remark != remark: + cursor.execute(""" + UPDATE sys_params + SET remark = %s + WHERE id = %s + """, (new_remark, param_id)) + + if cursor.rowcount > 0: + print(f"✓ Updated: {param_code}") + print(f" Old: {remark}") + print(f" New: {new_remark}") + total_updated += 1 + + connection.commit() + + if total_updated > 0: + print(f"\n✅ Successfully updated {total_updated} parameter remarks!") + else: + print("\n⚠️ No parameter remarks needed updating.") + + # Show final results + print("\n" + "=" * 60) + print("Final Parameter Remarks:") + print("=" * 60) + + cursor.execute(""" + SELECT param_code, remark + FROM sys_params + WHERE remark IS NOT NULL AND remark != '' + ORDER BY param_code + """) + + for param_code, remark in cursor.fetchall(): + print(f"{param_code}: {remark}") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/update_all_chinese.py b/main/xiaozhi-server/update_all_chinese.py new file mode 100644 index 000000000..192db8e66 --- /dev/null +++ b/main/xiaozhi-server/update_all_chinese.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Updating all Chinese model names to English...") + print("=" * 60) + + # Comprehensive list of updates + updates = [ + # TTS Models + ("302AI语音合成", "302AI TTS"), + ("ACGN语音合成", "ACGN TTS"), + ("Coze中文语音合成", "Coze Chinese TTS"), + ("FishSpeech语音合成", "FishSpeech TTS"), + ("机智云语音合成", "Gizwits TTS"), + ("火山双流式语音合成", "Volcano Dual-Stream TTS"), + ("火山引擎边缘大模型网关", "Volcano Edge Gateway"), + ("硅基流动语音合成", "SiliconFlow TTS"), + ("自定义语音合成", "Custom TTS"), + ("豆包语音合成", "Doubao TTS"), + ("阿里云语音合成", "Aliyun TTS"), + ("阿里云语音合成(流式)", "Aliyun TTS (Streaming)"), + ("Linkerai语音合成", "Linkerai TTS"), + ("MiniMax语音合成", "MiniMax TTS"), + ("OpenAI语音合成", "OpenAI TTS"), + ("Index-TTS-vLLM流式语音合成", "Index-TTS-vLLM Streaming"), + + # ASR Models + ("FunASR服务语音识别", "FunASR Server Recognition"), + ("FunASR语音识别", "FunASR Recognition"), + ("Groq语音识别", "Groq Speech Recognition"), + ("OpenAI语音识别", "OpenAI Speech Recognition"), + ("Sherpa语音识别", "Sherpa Speech Recognition"), + ("百度语音识别", "Baidu Speech Recognition"), + ("腾讯语音识别", "Tencent Speech Recognition"), + ("豆包语音识别", "Doubao Speech Recognition"), + ("豆包语音识别(流式)", "Doubao Speech Recognition (Streaming)"), + ("阿里云语音识别", "Aliyun Speech Recognition"), + ("阿里云语音识别(流式)", "Aliyun Speech Recognition (Streaming)"), + + # LLM Models + ("豆包大模型", "Doubao LLM"), + ("Ollama本地模型", "Ollama Local Model"), + ("Xinference大模型", "Xinference LLM"), + ("Xinference小模型", "Xinference Small Model"), + ("智谱AI", "Zhipu AI"), + ("谷歌Gemini", "Google Gemini"), + ("通义千问", "Tongyi Qianwen"), + ("通义百炼", "Tongyi Bailian"), + + # Intent Models + ("LLM意图识别", "LLM Intent Recognition"), + ("函数调用意图识别", "Function Call Intent"), + ("无意图识别", "No Intent Recognition"), + + # Memory Models + ("Mem0AI记忆", "Mem0AI Memory"), + ("无记忆", "No Memory"), + ("本地短期记忆", "Local Short-term Memory"), + + # Vision Models + ("千问视觉模型", "Qianwen Vision Model"), + ("智谱视觉AI", "Zhipu Vision AI"), + ] + + total_updated = 0 + for old_name, new_name in updates: + sql = "UPDATE ai_model_config SET model_name = %s WHERE model_name = %s" + cursor.execute(sql, (new_name, old_name)) + if cursor.rowcount > 0: + print(f"✓ Updated: '{old_name}' → '{new_name}'") + total_updated += 1 + + connection.commit() + + if total_updated > 0: + print(f"\n✅ Successfully updated {total_updated} model names!") + else: + print("\n⚠️ No models needed updating.") + + # Show final results + print("\n" + "=" * 60) + print("Final Model Names:") + print("=" * 60) + + cursor.execute(""" + SELECT model_type, model_name, id + FROM ai_model_config + ORDER BY model_type, model_name + """) + + current_type = None + for row in cursor.fetchall(): + if row[0] != current_type: + current_type = row[0] + print(f"\n{current_type.upper()} Models:") + print(f" - {row[1]} (ID: {row[2]})") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/update_edge_voices.py b/main/xiaozhi-server/update_edge_voices.py new file mode 100644 index 000000000..784d8071e --- /dev/null +++ b/main/xiaozhi-server/update_edge_voices.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + # First check the column size + cursor.execute(""" + SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = 'railway' + AND TABLE_NAME = 'ai_tts_voice' + AND COLUMN_NAME = 'name' + """) + + col_info = cursor.fetchone() + if col_info: + print(f"Column 'name' max length: {col_info[1]} characters") + + # Find EdgeTTS model + cursor.execute(""" + SELECT id, model_name + FROM ai_model_config + WHERE model_name LIKE '%Edge%' AND model_type = 'tts' + """) + edge_model = cursor.fetchone() + + if edge_model: + print(f"\nEdgeTTS Model: {edge_model[1]} (ID: {edge_model[0]})") + + # Get all EdgeTTS voices + cursor.execute(""" + SELECT id, name, tts_voice + FROM ai_tts_voice + WHERE tts_model_id = %s + ORDER BY name + """, (edge_model[0],)) + + voices = cursor.fetchall() + + print(f"\n" + "=" * 60) + print("Updating EdgeTTS Voice Names (keeping them short):") + print("=" * 60) + + # Shorter translations to fit within 20 characters + voice_translations = [ + # Female voices - keep under 20 chars + ("EdgeTTS女声-晓晓", "Xiaoxiao"), + ("EdgeTTS女声-晓伊", "Xiaoyi"), + ("EdgeTTS女声-晓双", "Xiaoshuang"), + ("EdgeTTS女声-晓萱", "Xiaoxuan"), + ("EdgeTTS女声-晓颜", "Xiaoyan"), + ("EdgeTTS女声-晓悠", "Xiaoyou"), + ("EdgeTTS女声-云夏", "Yunxia"), + ("EdgeTTS女声-云燕", "Yunyan"), + ("EdgeTTS女声-辽宁小贝", "Liaoning Xiaobei"), + ("EdgeTTS女声-陕西小妮", "Shaanxi Xiaoni"), + ("EdgeTTS女声-香港海佳", "HK HiuGaai"), + ("EdgeTTS女声-香港海曼", "HK HiuMaan"), + + # Male voices - keep under 20 chars + ("EdgeTTS男声-云健", "Yunjian"), + ("EdgeTTS男声-云泽", "Yunze"), + ("EdgeTTS男声-云希", "Yunxi"), + ("EdgeTTS男声-云扬", "Yunyang"), + ("EdgeTTS男声-云夏", "Yunxia"), + ("EdgeTTS男声-晓辰", "Xiaochen"), + ("EdgeTTS男声-香港万龙", "HK WanLung"), + + # English voices + ("EdgeTTS女声-Jenny", "Jenny"), + ("EdgeTTS女声-Aria", "Aria"), + ("EdgeTTS男声-Guy", "Guy"), + ("EdgeTTS男声-Davis", "Davis"), + ] + + updated_count = 0 + for old_name, new_name in voice_translations: + # Make sure new name is not too long + if len(new_name) <= 20: + cursor.execute(""" + UPDATE ai_tts_voice + SET name = %s + WHERE name = %s AND tts_model_id = %s + """, (new_name, old_name, edge_model[0])) + + if cursor.rowcount > 0: + print(f"✓ Updated: '{old_name}' → '{new_name}'") + updated_count += cursor.rowcount + else: + print(f"⚠️ Skipped (too long): '{new_name}' ({len(new_name)} chars)") + + connection.commit() + + if updated_count > 0: + print(f"\n✅ Successfully updated {updated_count} voice names!") + else: + print("\n⚠️ No voice names needed updating.") + + # Show final results + print("\n" + "=" * 60) + print("Updated EdgeTTS Voices:") + print("=" * 60) + + cursor.execute(""" + SELECT name, tts_voice, languages + FROM ai_tts_voice + WHERE tts_model_id = %s + ORDER BY name + """, (edge_model[0],)) + + print(f"{'Name':<20} {'Voice ID':<30} {'Languages':<20}") + print("-" * 70) + for voice in cursor.fetchall(): + print(f"{voice[0]:<20} {voice[1]:<30} {voice[2] or 'N/A':<20}") + else: + print("EdgeTTS model not found in database!") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/update_languages.py b/main/xiaozhi-server/update_languages.py new file mode 100644 index 000000000..7c9b13ad7 --- /dev/null +++ b/main/xiaozhi-server/update_languages.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + print("=" * 60) + print("Updating Language Names in TTS Voices:") + print("=" * 60) + + # Update language names + language_updates = [ + ("普通话", "Mandarin"), + ("粤语", "Cantonese"), + ("辽宁", "Liaoning"), + ("陕西", "Shaanxi"), + ("四川", "Sichuan"), + ("台湾", "Taiwan"), + ("香港", "Hong Kong"), + ("英语", "English"), + ("日语", "Japanese"), + ("韩语", "Korean"), + ("法语", "French"), + ("德语", "German"), + ("西班牙语", "Spanish"), + ("意大利语", "Italian"), + ("俄语", "Russian"), + ("阿拉伯语", "Arabic"), + ] + + total_updated = 0 + for old_lang, new_lang in language_updates: + cursor.execute(""" + UPDATE ai_tts_voice + SET languages = %s + WHERE languages = %s + """, (new_lang, old_lang)) + + if cursor.rowcount > 0: + print(f"✓ Updated {cursor.rowcount} voices: '{old_lang}' → '{new_lang}'") + total_updated += cursor.rowcount + + connection.commit() + + if total_updated > 0: + print(f"\n✅ Successfully updated {total_updated} language entries!") + + # Show final results for EdgeTTS + print("\n" + "=" * 60) + print("Final EdgeTTS Voice Configuration:") + print("=" * 60) + + cursor.execute(""" + SELECT v.name, v.tts_voice, v.languages, v.remark + FROM ai_tts_voice v + JOIN ai_model_config m ON v.tts_model_id = m.id + WHERE m.model_name LIKE '%Edge%' + ORDER BY v.name + """) + + voices = cursor.fetchall() + + print(f"{'Name':<20} {'Voice ID':<30} {'Language':<15} {'Remark':<20}") + print("-" * 85) + for voice in voices: + remark = (voice[3][:17] + '...') if voice[3] and len(voice[3]) > 20 else (voice[3] or '') + print(f"{voice[0]:<20} {voice[1]:<30} {voice[2] or 'N/A':<15} {remark:<20}") + +finally: + connection.close() \ No newline at end of file diff --git a/main/xiaozhi-server/update_tts_models.py b/main/xiaozhi-server/update_tts_models.py new file mode 100644 index 000000000..b83b11bc9 --- /dev/null +++ b/main/xiaozhi-server/update_tts_models.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import pymysql +import json +import sys + +# Set UTF-8 encoding for output +if sys.platform == "win32": + import io + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') + +# Database connection +connection = pymysql.connect( + host='nozomi.proxy.rlwy.net', + port=25037, + user='root', + password='OcaVNLKcwNdyElfaeUPqvvfYZiiEHgdm', + database='railway', + charset='utf8mb4' +) + +try: + with connection.cursor() as cursor: + # Check TTS models + print("=" * 60) + print("Current TTS Models in Database:") + print("=" * 60) + + sql = """ + SELECT id, model_name, model_type, config_json + FROM ai_model_config + WHERE model_type = 'tts' OR model_name LIKE '%Edge%' OR model_name LIKE '%语音%' OR model_name LIKE '%TTS%' + ORDER BY model_name + """ + cursor.execute(sql) + results = cursor.fetchall() + + if not results: + print("No TTS models found. Checking all models...") + cursor.execute("SELECT id, model_name, model_type FROM ai_model_config") + results = cursor.fetchall() + + for row in results: + print(f"\nID: {row[0]}") + print(f"Model Name: {row[1]}") + print(f"Model Type: {row[2]}") + if len(row) > 3 and row[3]: + try: + config = json.loads(row[3]) + print(f"Config Type: {config.get('type', 'N/A')}") + except: + pass + + # Update the Chinese text to English + print("\n" + "=" * 60) + print("Updating Chinese model names to English...") + print("=" * 60) + + updates = [ + ("Edge语音合成", "Edge TTS"), + ("Edge TTS语音合成", "Edge TTS"), + ("百度语音合成", "Baidu TTS"), + ("阿里语音合成", "Ali TTS"), + ("腾讯语音合成", "Tencent TTS"), + ("科大讯飞语音合成", "iFlytek TTS"), + ("讯飞语音合成", "iFlytek TTS"), + ("微软语音合成", "Microsoft TTS"), + ("谷歌语音合成", "Google TTS"), + # Also update other model types if needed + ("语音识别", "Speech Recognition"), + ("语音活动检测", "Voice Activity Detection"), + ("大语言模型", "Large Language Model"), + ("视觉大模型", "Vision Language Model"), + ("意图识别", "Intent Recognition"), + ("记忆模型", "Memory Model") + ] + + for old_name, new_name in updates: + sql = "UPDATE ai_model_config SET model_name = %s WHERE model_name = %s" + cursor.execute(sql, (new_name, old_name)) + if cursor.rowcount > 0: + print(f"✓ Updated: '{old_name}' → '{new_name}'") + + # Also check for partial matches and update them + cursor.execute("SELECT id, model_name FROM ai_model_config WHERE model_name LIKE '%语音%' OR model_name LIKE '%模型%'") + chinese_models = cursor.fetchall() + + if chinese_models: + print("\nFound models with Chinese characters:") + for model_id, model_name in chinese_models: + print(f" - {model_name} (ID: {model_id})") + + connection.commit() + print("\n✅ All model names have been updated to English!") + + # Verify the changes + print("\n" + "=" * 60) + print("Updated Models (showing all):") + print("=" * 60) + + cursor.execute(""" + SELECT model_type, model_name, id + FROM ai_model_config + ORDER BY model_type, model_name + """) + + current_type = None + for row in cursor.fetchall(): + if row[0] != current_type: + current_type = row[0] + print(f"\n{current_type.upper()} Models:") + print(f" - {row[1]} (ID: {row[2]})") + +finally: + connection.close() \ No newline at end of file