From 3757c5dde7800fb6bc05bc19d20cdc37efe27f79 Mon Sep 17 00:00:00 2001 From: sczx-win10 Date: Tue, 22 Apr 2025 16:44:45 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtts=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E4=B8=8D=E9=87=8D=E8=AF=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/providers/tts/base.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main/xiaozhi-server/core/providers/tts/base.py b/main/xiaozhi-server/core/providers/tts/base.py index e39ca65c..f34158d1 100644 --- a/main/xiaozhi-server/core/providers/tts/base.py +++ b/main/xiaozhi-server/core/providers/tts/base.py @@ -26,10 +26,14 @@ class TTSProviderBase(ABC): max_repeat_time = 5 text = MarkdownCleaner.clean_markdown(text) while not os.path.exists(tmp_file) and max_repeat_time > 0: - asyncio.run(self.text_to_speak(text, tmp_file)) - if not os.path.exists(tmp_file): - max_repeat_time = max_repeat_time - 1 - logger.bind(tag=TAG).error(f"语音生成失败: {text}:{tmp_file},再试{max_repeat_time}次") + try: + asyncio.run(self.text_to_speak(text, tmp_file)) + except Exception as e: + logger.bind(tag=TAG).error(f"语音生成失败: {text},错误: {e}") + max_repeat_time -= 1 + if max_repeat_time > 0: + logger.bind(tag=TAG).error(f"再试{max_repeat_time}次") + asyncio.sleep(max_repeat_time / 10) if max_repeat_time > 0: logger.bind(tag=TAG).info(f"语音生成成功: {text}:{tmp_file},重试{5 - max_repeat_time}次") From d57482d966b6c59c0df928ea414b4f239985af72 Mon Sep 17 00:00:00 2001 From: Liu Ruichao Date: Tue, 22 Apr 2025 17:01:53 +0800 Subject: [PATCH 2/8] feat: add Volces AI Gateway LLM/TTS --- .../resources/db/changelog/202504221555.sql | 49 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 9 +++- main/xiaozhi-server/config.yaml | 25 ++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 main/manager-api/src/main/resources/db/changelog/202504221555.sql diff --git a/main/manager-api/src/main/resources/db/changelog/202504221555.sql b/main/manager-api/src/main/resources/db/changelog/202504221555.sql new file mode 100644 index 00000000..8d62876a --- /dev/null +++ b/main/manager-api/src/main/resources/db/changelog/202504221555.sql @@ -0,0 +1,49 @@ +-- 添加火山引擎边缘大模型网关(LLM + TTS) +INSERT INTO `ai_model_config` VALUES ('LLM_VolcesAiGatewayLLM', 'LLM', 'VolcesAiGatewayTTS', '火山引擎边缘大模型网关', 0, 1, '{\"type\": \"openai\", \"base_url\": \"https://ai-gateway.vei.volces.com/v1\", \"model_name\": \"doubao-pro-32k-functioncall\", \"api_key\": \"你的网关访问密钥\"}', NULL, NULL, 14, NULL, NULL, NULL, NULL); +INSERT INTO `ai_model_config` VALUES ('TTS_VolcesAiGatewayTTS', 'TTS', 'VolcesAiGatewayTTS', '火山引擎边缘大模型网关', 0, 1, '{\"type\": \"openai\", \"api_key\": \"你的网关访问密钥\", \"api_url\": \"https://ai-gateway.vei.volces.com/v1/audio/speech\", \"model\": \"doubao-tts\", \"voice\": \"zh_male_shaonianzixin_moon_bigtts\", \"speed\": 1, \"output_dir\": \"tmp/\"}', NULL, NULL, 15, NULL, NULL, NULL, NULL); +-- 添加火山引擎边缘大模型网关语音合成音色 +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0001', 'TTS_VolcesAiGatewayTTS', '灿灿/Shiny', 'zh_female_cancan_mars_bigtts', '中文、美式英语', NULL, NULL, 1, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0002', 'TTS_VolcesAiGatewayTTS', '清新女声', 'zh_female_qingxinnvsheng_mars_bigtts', '中文', NULL, NULL, 2, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0003', 'TTS_VolcesAiGatewayTTS', '爽快思思/Skye', 'zh_female_shuangkuaisisi_moon_bigtts', '中文、美式英语', NULL, NULL, 3, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0004', 'TTS_VolcesAiGatewayTTS', '温暖阿虎/Alvin', 'zh_male_wennuanahu_moon_bigtts', '中文、美式英语', NULL, NULL, 4, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0005', 'TTS_VolcesAiGatewayTTS', '少年梓辛/Brayan', 'zh_male_shaonianzixin_moon_bigtts', '中文、美式英语', NULL, NULL, 5, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0006', 'TTS_VolcesAiGatewayTTS', '知性女声', 'zh_female_zhixingnvsheng_mars_bigtts', '中文', NULL, NULL, 6, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0007', 'TTS_VolcesAiGatewayTTS', '清爽男大', 'zh_male_qingshuangnanda_mars_bigtts', '中文', NULL, NULL, 7, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0008', 'TTS_VolcesAiGatewayTTS', '邻家女孩', 'zh_female_linjianvhai_moon_bigtts', '中文', NULL, NULL, 8, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0009', 'TTS_VolcesAiGatewayTTS', '渊博小叔', 'zh_male_yuanboxiaoshu_moon_bigtts', '中文', NULL, NULL, 9, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0010', 'TTS_VolcesAiGatewayTTS', '阳光青年', 'zh_male_yangguangqingnian_moon_bigtts', '中文', NULL, NULL, 10, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0011', 'TTS_VolcesAiGatewayTTS', '甜美小源', 'zh_female_tianmeixiaoyuan_moon_bigtts', '中文', NULL, NULL, 11, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0012', 'TTS_VolcesAiGatewayTTS', '清澈梓梓', 'zh_female_qingchezizi_moon_bigtts', '中文', NULL, NULL, 12, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0013', 'TTS_VolcesAiGatewayTTS', '解说小明', 'zh_male_jieshuoxiaoming_moon_bigtts', '中文', NULL, NULL, 13, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0014', 'TTS_VolcesAiGatewayTTS', '开朗姐姐', 'zh_female_kailangjiejie_moon_bigtts', '中文', NULL, NULL, 14, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0015', 'TTS_VolcesAiGatewayTTS', '邻家男孩', 'zh_male_linjiananhai_moon_bigtts', '中文', NULL, NULL, 15, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0016', 'TTS_VolcesAiGatewayTTS', '甜美悦悦', 'zh_female_tianmeiyueyue_moon_bigtts', '中文', NULL, NULL, 16, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0017', 'TTS_VolcesAiGatewayTTS', '心灵鸡汤', 'zh_female_xinlingjitang_moon_bigtts', '中文', NULL, NULL, 17, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0018', 'TTS_VolcesAiGatewayTTS', '知性温婉', 'ICL_zh_female_zhixingwenwan_tob', '中文', NULL, NULL, 18, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0019', 'TTS_VolcesAiGatewayTTS', '暖心体贴', 'ICL_zh_male_nuanxintitie_tob', '中文', NULL, NULL, 19, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0020', 'TTS_VolcesAiGatewayTTS', '温柔文雅', 'ICL_zh_female_wenrouwenya_tob', '中文', NULL, NULL, 20, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0021', 'TTS_VolcesAiGatewayTTS', '开朗轻快', 'ICL_zh_male_kailangqingkuai_tob', '中文', NULL, NULL, 21, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0022', 'TTS_VolcesAiGatewayTTS', '活泼爽朗', 'ICL_zh_male_huoposhuanglang_tob', '中文', NULL, NULL, 22, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0023', 'TTS_VolcesAiGatewayTTS', '率真小伙', 'ICL_zh_male_shuaizhenxiaohuo_tob', '中文', NULL, NULL, 23, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0024', 'TTS_VolcesAiGatewayTTS', '温柔小哥', 'zh_male_wenrouxiaoge_mars_bigtts', '中文', NULL, NULL, 24, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0025', 'TTS_VolcesAiGatewayTTS', 'Smith', 'en_male_smith_mars_bigtts', '英式英语', NULL, NULL, 25, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0026', 'TTS_VolcesAiGatewayTTS', 'Anna', 'en_female_anna_mars_bigtts', '英式英语', NULL, NULL, 26, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0027', 'TTS_VolcesAiGatewayTTS', 'Adam', 'en_male_adam_mars_bigtts', '美式英语', NULL, NULL, 27, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0028', 'TTS_VolcesAiGatewayTTS', 'Sarah', 'en_female_sarah_mars_bigtts', '澳洲英语', NULL, NULL, 28, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0029', 'TTS_VolcesAiGatewayTTS', 'Dryw', 'en_male_dryw_mars_bigtts', '澳洲英语', NULL, NULL, 29, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0030', 'TTS_VolcesAiGatewayTTS', 'かずね(和音)/Javier or Álvaro', 'multi_male_jingqiangkanye_moon_bigtts', '日语、西语', NULL, NULL, 30, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0031', 'TTS_VolcesAiGatewayTTS', 'はるこ(晴子)/Esmeralda', 'multi_female_shuangkuaisisi_moon_bigtts', '日语、西语', NULL, NULL, 31, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0032', 'TTS_VolcesAiGatewayTTS', 'ひろし(広志)/Roberto', 'multi_male_wanqudashu_moon_bigtts', '日语、西语', NULL, NULL, 32, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0033', 'TTS_VolcesAiGatewayTTS', 'あけみ(朱美)', 'multi_female_gaolengyujie_moon_bigtts', '日语', NULL, NULL, 33, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0034', 'TTS_VolcesAiGatewayTTS', 'Amanda', 'en_female_amanda_mars_bigtts', '美式英语', NULL, NULL, 34, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0035', 'TTS_VolcesAiGatewayTTS', 'Jackson', 'en_male_jackson_mars_bigtts', '美式英语', NULL, NULL, 35, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0036', 'TTS_VolcesAiGatewayTTS', '京腔侃爷/Harmony', 'zh_male_jingqiangkanye_moon_bigtts', '中文-北京口音、英文', NULL, NULL, 36, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0037', 'TTS_VolcesAiGatewayTTS', '湾湾小何', 'zh_female_wanwanxiaohe_moon_bigtts', '中文-台湾口音', NULL, NULL, 37, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0038', 'TTS_VolcesAiGatewayTTS', '湾区大叔', 'zh_female_wanqudashu_moon_bigtts', '中文-广东口音', NULL, NULL, 38, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0039', 'TTS_VolcesAiGatewayTTS', '呆萌川妹', 'zh_female_daimengchuanmei_moon_bigtts', '中文-四川口音', NULL, NULL, 39, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0040', 'TTS_VolcesAiGatewayTTS', '广州德哥', 'zh_male_guozhoudege_moon_bigtts', '中文-广东口音', NULL, NULL, 40, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0041', 'TTS_VolcesAiGatewayTTS', '北京小爷', 'zh_male_beijingxiaoye_moon_bigtts', '中文-北京口音', NULL, NULL, 41, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0042', 'TTS_VolcesAiGatewayTTS', '浩宇小哥', 'zh_male_haoyuxiaoge_moon_bigtts', '中文-青岛口音', NULL, NULL, 42, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0043', 'TTS_VolcesAiGatewayTTS', '广西远舟', 'zh_male_guangxiyuanzhou_moon_bigtts', '中文-广西口音', NULL, NULL, 43, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0044', 'TTS_VolcesAiGatewayTTS', '妹坨洁儿', 'zh_female_meituojieer_moon_bigtts', '中文-长沙口音', NULL, NULL, 44, NULL, NULL, NULL, NULL); +INSERT INTO `ai_tts_voice` VALUES ('TTS_VolcesAiGatewayTTS_0045', 'TTS_VolcesAiGatewayTTS', '豫州子轩', 'zh_male_yuzhouzixuan_moon_bigtts', '中文-河南口音', NULL, NULL, 45, NULL, NULL, NULL, NULL); \ No newline at end of file diff --git a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml index b84a6225..60fd0280 100755 --- a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml @@ -71,4 +71,11 @@ databaseChangeLog: changes: - sqlFile: encoding: utf8 - path: classpath:db/changelog/202504211118.sql \ No newline at end of file + path: classpath:db/changelog/202504211118.sql + - changeSet: + id: 202504221555 + author: John + changes: + - sqlFile: + encoding: utf8 + path: classpath:db/changelog/202504221555.sql \ No newline at end of file diff --git a/main/xiaozhi-server/config.yaml b/main/xiaozhi-server/config.yaml index 0f694fba..696c82d0 100644 --- a/main/xiaozhi-server/config.yaml +++ b/main/xiaozhi-server/config.yaml @@ -314,6 +314,17 @@ LLM: bot_id: "你的bot_id" user_id: "你的user_id" personal_access_token: 你的coze个人令牌 + VolcesAiGatewayLLM: + # 火山引擎 - 边缘大模型网关 + # 定义LLM API类型 + type: openai + # 先开通服务,打开以下网址,创建网关访问密钥,搜索并勾选 Doubao-pro-32k-functioncall ,开通 + # 如果需要使用边缘大模型网关提供的语音合成,一并勾选 Doubao-语音合成 ,另见 TTS.VolcesAiGatewayTTS 配置 + # https://console.volcengine.com/vei/aigateway/ + # 开通后,进入这里获取密钥:https://console.volcengine.com/vei/aigateway/tokens-list + base_url: https://ai-gateway.vei.volces.com/v1 + model_name: doubao-pro-32k-functioncall + api_key: 你的网关访问密钥 LMStudioLLM: # 定义LLM API类型 type: openai @@ -382,6 +393,20 @@ TTS: output_dir: tmp/ access_token: 你的coze web key response_format: wav + VolcesAiGatewayTTS: + type: openai + # 火山引擎 - 边缘大模型网关 + # 先开通服务,打开以下网址,创建网关访问密钥,搜索并勾选 Doubao-语音合成 ,开通 + # 如果需要使用边缘大模型网关提供的 LLM,一并勾选 Doubao-pro-32k-functioncall ,另见 LLM.VolcesAiGatewayLLM 配置 + # https://console.volcengine.com/vei/aigateway/ + # 开通后,进入这里获取密钥:https://console.volcengine.com/vei/aigateway/tokens-list + api_key: 你的网关访问密钥 + api_url: https://ai-gateway.vei.volces.com/v1/audio/speech + model: doubao-tts + # 音色列表见 https://www.volcengine.com/docs/6561/1257544 + voice: zh_male_shaonianzixin_moon_bigtts + speed: 1 + output_dir: tmp/ FishSpeech: # 定义TTS API类型 #启动tts方法: From 7f76b5f4eeb77426f147cde7b5c12b34d4272e0d Mon Sep 17 00:00:00 2001 From: Liu Ruichao Date: Wed, 23 Apr 2025 10:49:50 +0800 Subject: [PATCH 3/8] add PUBLIC_PATH env --- main/manager-web/.env.production | 1 + main/manager-web/package.json | 1 + main/manager-web/vue.config.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main/manager-web/.env.production b/main/manager-web/.env.production index d61ca06f..351d791a 100644 --- a/main/manager-web/.env.production +++ b/main/manager-web/.env.production @@ -1,3 +1,4 @@ VUE_APP_API_BASE_URL=/xiaozhi +VUE_APP_PUBLIC_PATH=/ # 是否开启CDN VUE_APP_USE_CDN=false \ No newline at end of file diff --git a/main/manager-web/package.json b/main/manager-web/package.json index a308147b..55e275d9 100644 --- a/main/manager-web/package.json +++ b/main/manager-web/package.json @@ -10,6 +10,7 @@ "dependencies": { "core-js": "^3.41.0", "cross-env": "^7.0.3", + "dotenv": "^16.5.0", "element-ui": "^2.15.14", "flyio": "^0.6.14", "normalize.css": "^8.0.1", diff --git a/main/manager-web/vue.config.js b/main/manager-web/vue.config.js index e61c0628..1c2e6b04 100644 --- a/main/manager-web/vue.config.js +++ b/main/manager-web/vue.config.js @@ -39,7 +39,7 @@ const cdnResources = { const useCDN = process.env.VUE_APP_USE_CDN === 'true'; module.exports = defineConfig({ - productionSourceMap: process.env.NODE_ENV === 'production' ? false : true, // 生产环境不生成 source map + productionSourceMap: process.env.NODE_ENV !=='production', // 生产环境不生成 source map devServer: { port: 8001, // 指定端口为 8001 proxy: { @@ -52,6 +52,7 @@ module.exports = defineConfig({ overlay: false, // 不显示 webpack 错误覆盖层 }, }, + publicPath: process.env.VUE_APP_PUBLIC_PATH || "", chainWebpack: config => { // 修改 HTML 插件配置,动态插入 CDN 链接 From 497fc1d1ae549b279943ad6310ae542b538ec13a Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Thu, 24 Apr 2025 10:41:14 +0800 Subject: [PATCH 4/8] =?UTF-8?q?update:=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B7=A6=E4=BE=A7=E6=A0=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/manager-web/src/views/ModelConfig.vue | 39 ++-- main/manager-web/src/views/OtaManagement.vue | 7 +- .../src/views/ParamsManagement.vue | 215 +++++++++--------- main/manager-web/src/views/UserManagement.vue | 127 +++++------ 4 files changed, 190 insertions(+), 198 deletions(-) diff --git a/main/manager-web/src/views/ModelConfig.vue b/main/manager-web/src/views/ModelConfig.vue index 8add3398..aa788f2f 100644 --- a/main/manager-web/src/views/ModelConfig.vue +++ b/main/manager-web/src/views/ModelConfig.vue @@ -44,19 +44,11 @@
- + @@ -136,6 +128,9 @@
+ + + @@ -145,9 +140,9 @@ import AddModelDialog from "@/components/AddModelDialog.vue"; import HeaderBar from "@/components/HeaderBar.vue"; import ModelEditDialog from "@/components/ModelEditDialog.vue"; import TtsModel from "@/components/TtsModel.vue"; - +import VersionFooter from "@/components/VersionFooter.vue"; export default { - components: { HeaderBar, ModelEditDialog, TtsModel, AddModelDialog }, + components: { HeaderBar, ModelEditDialog, TtsModel, AddModelDialog, VersionFooter }, data() { return { addDialogVisible: false, @@ -520,8 +515,9 @@ export default { .nav-panel .el-menu-item { height: 50px; + background: #e9f0ff; line-height: 50px; - border-radius: 4px; + border-radius: 4px 0 0 4px !important; transition: all 0.3s; display: flex !important; justify-content: flex-end; @@ -532,8 +528,7 @@ export default { } .nav-panel .el-menu-item.is-active { - background: #e9f0ff; - color: #0ba6f4 !important; + background: #5778ff; position: relative; padding-left: 40px !important; } @@ -546,7 +541,7 @@ export default { transform: translateY(-50%); width: 13px; height: 13px; - background: #409EFF; + background: #fff; border-radius: 50%; box-shadow: 0 0 4px rgba(64, 158, 255, 0.5); } @@ -758,7 +753,7 @@ export default { } ::v-deep .nav-panel .el-menu-item.is-active .menu-text { - color: #409EFF !important; + color: #fff !important; } ::v-deep .data-table { @@ -929,17 +924,19 @@ export default { background-color: rgba(255, 255, 255, 0.6) !important; backdrop-filter: blur(2px); } + ::v-deep .el-loading-spinner .circular { width: 28px; height: 28px; } + ::v-deep .el-loading-spinner .path { stroke: #6b8cff; } + ::v-deep .el-loading-text { color: #6b8cff !important; font-size: 14px; margin-top: 8px; } - diff --git a/main/manager-web/src/views/OtaManagement.vue b/main/manager-web/src/views/OtaManagement.vue index 13ffacf9..76bbeeec 100644 --- a/main/manager-web/src/views/OtaManagement.vue +++ b/main/manager-web/src/views/OtaManagement.vue @@ -91,7 +91,9 @@ - + + + @@ -99,11 +101,12 @@ import Api from "@/apis/api"; import FirmwareDialog from "@/components/FirmwareDialog.vue"; import HeaderBar from "@/components/HeaderBar.vue"; +import VersionFooter from "@/components/VersionFooter.vue"; import { FIRMWARE_TYPES } from "@/utils"; import { formatDate, formatFileSize } from "@/utils/format"; export default { - components: { HeaderBar, FirmwareDialog }, + components: { HeaderBar, FirmwareDialog, VersionFooter }, data() { return { searchName: "", diff --git a/main/manager-web/src/views/ParamsManagement.vue b/main/manager-web/src/views/ParamsManagement.vue index 8bca20f1..3301bbb5 100644 --- a/main/manager-web/src/views/ParamsManagement.vue +++ b/main/manager-web/src/views/ParamsManagement.vue @@ -15,15 +15,10 @@
- + @@ -91,9 +85,9 @@ import Api from "@/apis/api"; import HeaderBar from "@/components/HeaderBar.vue"; import ParamDialog from "@/components/ParamDialog.vue"; - +import VersionFooter from "@/components/VersionFooter.vue"; export default { - components: { HeaderBar, ParamDialog }, + components: { HeaderBar, ParamDialog, VersionFooter }, data() { return { searchCode: "", @@ -146,29 +140,29 @@ export default { this.fetchParams(); }, fetchParams() { - this.loading = true; - Api.admin.getParamsList( - { - page: this.currentPage, - limit: this.pageSize, - paramCode: this.searchCode, - }, - ({ data }) => { - this.loading = false; - if (data.code === 0) { - this.paramsList = data.data.list.map(item => ({ - ...item, - selected: false - })); - this.total = data.data.total; - } else { - this.$message.error({ - message: data.msg || '获取参数列表失败', - showClose: true - }); - } - } - ); + this.loading = true; + Api.admin.getParamsList( + { + page: this.currentPage, + limit: this.pageSize, + paramCode: this.searchCode, + }, + ({ data }) => { + this.loading = false; + if (data.code === 0) { + this.paramsList = data.data.list.map(item => ({ + ...item, + selected: false + })); + this.total = data.data.total; + } else { + this.$message.error({ + message: data.msg || '获取参数列表失败', + showClose: true + }); + } + } + ); }, handleSearch() { this.currentPage = 1; @@ -197,33 +191,33 @@ export default { }, handleSubmit({ form, done }) { - if (form.id) { - // 编辑 - Api.admin.updateParam(form, ({ data }) => { - if (data.code === 0) { - this.$message.success({ - message:"修改成功", - showClose:true + if (form.id) { + // 编辑 + Api.admin.updateParam(form, ({ data }) => { + if (data.code === 0) { + this.$message.success({ + message: "修改成功", + showClose: true + }); + this.dialogVisible = false; + this.fetchParams(); + } + done && done(); }); - this.dialogVisible = false; - this.fetchParams(); - } - done && done(); - }); - } else { - // 新增 - Api.admin.addParam(form, ({ data }) => { - if (data.code === 0) { - this.$message.success({ - message:"新增成功", - showClose:true + } else { + // 新增 + Api.admin.addParam(form, ({ data }) => { + if (data.code === 0) { + this.$message.success({ + message: "新增成功", + showClose: true + }); + this.dialogVisible = false; + this.fetchParams(); + } + done && done(); }); - this.dialogVisible = false; - this.fetchParams(); - } - done && done(); - }); - } + } }, deleteSelectedParams() { @@ -243,8 +237,8 @@ export default { if (Array.isArray(row) && row.length === 0) { this.$message.warning({ - message:"请先选择需要删除的参数", - showClose:true + message: "请先选择需要删除的参数", + showClose: true }); return; } @@ -259,8 +253,8 @@ export default { const ids = params.map(param => param.id); if (ids.some(id => isNaN(id))) { this.$message.error({ - message:'存在无效的参数ID', - showClose: true + message: '存在无效的参数ID', + showClose: true }); return; } @@ -341,16 +335,16 @@ export default { } .main-wrapper { - margin: 5px 22px; - border-radius: 15px; - min-height: calc(100vh - 24vh); - height: auto; - max-height: 80vh; - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); - position: relative; - background: rgba(237, 242, 255, 0.5); - display: flex; - flex-direction: column; + margin: 5px 22px; + border-radius: 15px; + min-height: calc(100vh - 24vh); + height: auto; + max-height: 80vh; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); + position: relative; + background: rgba(237, 242, 255, 0.5); + display: flex; + flex-direction: column; } .operation-bar { @@ -402,21 +396,21 @@ export default { } .params-card { - background: white; - flex: 1; - display: flex; - flex-direction: column; - border: none; - box-shadow: none; - overflow: hidden; - - ::v-deep .el-card__body { - padding: 15px; + background: white; + flex: 1; display: flex; flex-direction: column; - flex: 1; + border: none; + box-shadow: none; overflow: hidden; - } + + ::v-deep .el-card__body { + padding: 15px; + display: flex; + flex-direction: column; + flex: 1; + overflow: hidden; + } } .table_bottom { @@ -467,7 +461,7 @@ export default { gap: 10px; .el-select { - margin-right: 8px; + margin-right: 8px; } .pagination-btn:first-child, @@ -535,15 +529,17 @@ export default { width: 100%; display: flex; flex-direction: column; + .el-table__body-wrapper { - flex: 1; - overflow-y: auto; - max-height: none !important; + flex: 1; + overflow-y: auto; + max-height: none !important; } .el-table__header-wrapper { - flex-shrink: 0; + flex-shrink: 0; } + .el-table__header th { background: white !important; color: black; @@ -670,32 +666,31 @@ export default { } .el-table { - --table-max-height: calc(100vh - 40vh); - max-height: var(--table-max-height); + --table-max-height: calc(100vh - 40vh); + max-height: var(--table-max-height); - .el-table__body-wrapper { - max-height: calc(var(--table-max-height) - 40px); - } + .el-table__body-wrapper { + max-height: calc(var(--table-max-height) - 40px); + } } :deep(.el-loading-mask) { - background-color: rgba(255, 255, 255, 0.6) !important; - backdrop-filter: blur(2px); + background-color: rgba(255, 255, 255, 0.6) !important; + backdrop-filter: blur(2px); } :deep(.el-loading-spinner .circular) { - width: 28px; - height: 28px; + width: 28px; + height: 28px; } :deep(.el-loading-spinner .path) { - stroke: #6b8cff; + stroke: #6b8cff; } :deep(.el-loading-text) { - color: #6b8cff !important; - font-size: 14px; - margin-top: 8px; + color: #6b8cff !important; + font-size: 14px; + margin-top: 8px; } - diff --git a/main/manager-web/src/views/UserManagement.vue b/main/manager-web/src/views/UserManagement.vue index 1ca70422..eb43a959 100644 --- a/main/manager-web/src/views/UserManagement.vue +++ b/main/manager-web/src/views/UserManagement.vue @@ -15,18 +15,13 @@
- + - + @@ -61,11 +56,7 @@
- + @@ -90,16 +81,19 @@
+ + +