From 98a14830328c95f7ad83baf7bb243c4f41da8de4 Mon Sep 17 00:00:00 2001
From: rainv123 <2148537152@qq.com>
Date: Thu, 11 Sep 2025 17:10:50 +0800
Subject: [PATCH] =?UTF-8?q?updata:=E6=99=BA=E6=8E=A7=E5=8F=B0=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=AF=AD=E8=A8=80=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E4=B8=AD=E8=8B=B1=E7=B9=81=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/manager-web/package.json | 1 +
main/manager-web/src/App.vue | 63 +-
.../src/components/AddDeviceDialog.vue | 16 +-
.../src/components/AddModelDialog.vue | 38 +-
.../src/components/AddWisdomBodyDialog.vue | 14 +-
.../src/components/CacheViewer.vue | 62 +-
.../src/components/ChangePasswordDialog.vue | 31 +-
.../src/components/ChatHistoryDialog.vue | 12 +-
.../manager-web/src/components/DeviceItem.vue | 48 +-
.../src/components/DictDataDialog.vue | 22 +-
.../src/components/DictTypeDialog.vue | 20 +-
.../src/components/EditVoiceDialog.vue | 34 +-
.../src/components/FirmwareDialog.vue | 60 +-
.../src/components/FunctionDialog.vue | 57 +-
main/manager-web/src/components/HeaderBar.vue | 131 ++-
.../src/components/ManualAddDeviceDialog.vue | 38 +-
.../src/components/ModelEditDialog.vue | 40 +-
.../src/components/ParamDialog.vue | 40 +-
.../src/components/ProviderDialog.vue | 134 +--
main/manager-web/src/components/TtsModel.vue | 88 +-
.../src/components/VoicePrintDialog.vue | 24 +-
main/manager-web/src/i18n/en.js | 801 +++++++++++++++++
main/manager-web/src/i18n/index.js | 43 +
main/manager-web/src/i18n/zh_CN.js | 801 +++++++++++++++++
main/manager-web/src/i18n/zh_TW.js | 802 ++++++++++++++++++
main/manager-web/src/main.js | 5 +
.../src/views/DeviceManagement.vue | 120 +--
main/manager-web/src/views/DictManagement.vue | 157 ++--
main/manager-web/src/views/ModelConfig.vue | 170 ++--
main/manager-web/src/views/OtaManagement.vue | 91 +-
.../src/views/ParamsManagement.vue | 251 +++---
.../src/views/ProviderManagement.vue | 156 ++--
.../src/views/ServerSideManager.vue | 79 +-
main/manager-web/src/views/UserManagement.vue | 76 +-
main/manager-web/src/views/VoicePrint.vue | 46 +-
main/manager-web/src/views/auth.scss | 2 +-
main/manager-web/src/views/home.vue | 21 +-
main/manager-web/src/views/login.vue | 108 ++-
main/manager-web/src/views/register.vue | 35 +-
.../src/views/retrievePassword.vue | 33 +-
main/manager-web/src/views/roleConfig.vue | 91 +-
41 files changed, 3800 insertions(+), 1061 deletions(-)
create mode 100644 main/manager-web/src/i18n/en.js
create mode 100644 main/manager-web/src/i18n/index.js
create mode 100644 main/manager-web/src/i18n/zh_CN.js
create mode 100644 main/manager-web/src/i18n/zh_TW.js
diff --git a/main/manager-web/package.json b/main/manager-web/package.json
index 55e275d9..75471a5e 100644
--- a/main/manager-web/package.json
+++ b/main/manager-web/package.json
@@ -18,6 +18,7 @@
"opus-recorder": "^8.0.5",
"vue": "^2.6.14",
"vue-axios": "^3.5.2",
+ "vue-i18n": "^8.28.2",
"vue-router": "^3.6.5",
"vuex": "^3.6.2",
"xiaozhi": "file:"
diff --git a/main/manager-web/src/App.vue b/main/manager-web/src/App.vue
index 74ad2af8..180f8f0d 100644
--- a/main/manager-web/src/App.vue
+++ b/main/manager-web/src/App.vue
@@ -50,6 +50,7 @@ import CacheViewer from '@/components/CacheViewer.vue';
import { logCacheStatus } from '@/utils/cacheViewer';
export default {
+ name: 'App',
components: {
CacheViewer
},
@@ -78,7 +79,7 @@ export default {
// 在控制台输出提示信息
console.info(
- '%c[小智服务] CDN缓存检查工具已加载',
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.cdnEnabled'),
'color: #409EFF; font-weight: bold;'
);
console.info(
@@ -89,7 +90,7 @@ export default {
this.checkServiceWorkerStatus();
} else {
console.info(
- '%c[小智服务] CDN模式已禁用,使用本地打包资源',
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.cdnDisabled'),
'color: #67C23A; font-weight: bold;'
);
}
@@ -119,7 +120,7 @@ export default {
const registrations = await navigator.serviceWorker.getRegistrations();
if (registrations.length > 0) {
console.info(
- '%c[小智服务] Service Worker已注册',
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.serviceWorkerRegistered'),
'color: #67C23A; font-weight: bold;'
);
@@ -128,46 +129,46 @@ export default {
const hasCaches = await logCacheStatus();
if (!hasCaches) {
console.info(
- '%c[小智服务] 还未检测到缓存,请刷新页面或等待缓存建立',
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.noCacheDetected'),
+ 'color: #E6A23C; font-weight: bold;'
+ );
+
+ // 开发环境下提供额外提示
+ if (process.env.NODE_ENV === 'development') {
+ console.info(
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.swDevEnvWarning'),
'color: #E6A23C; font-weight: bold;'
);
-
- // 开发环境下提供额外提示
- if (process.env.NODE_ENV === 'development') {
- console.info(
- '%c[小智服务] 在开发环境中,Service Worker可能无法正常初始化缓存',
- 'color: #E6A23C; font-weight: bold;'
- );
- console.info('请尝试以下方法检查Service Worker是否生效:');
- console.info('1. 在开发者工具的Application/Application标签页中查看Service Worker状态');
- console.info('2. 在开发者工具的Application/Cache/Cache Storage中查看缓存内容');
- console.info('3. 使用生产构建(npm run build)并通过HTTP服务器访问以测试完整功能');
- }
+ console.info(this.$t('cache.swCheckMethods'));
+ console.info('1. ' + this.$t('cache.swCheckMethod1'));
+ console.info('2. ' + this.$t('cache.swCheckMethod2'));
+ console.info('3. ' + this.$t('cache.swCheckMethod3'));
+ }
}
}, 2000);
} else {
console.info(
- '%c[小智服务] Service Worker未注册,CDN资源可能无法缓存',
- 'color: #F56C6C; font-weight: bold;'
- );
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.serviceWorkerNotRegistered'),
+ 'color: #F56C6C; font-weight: bold;'
+ );
- if (process.env.NODE_ENV === 'development') {
- console.info(
- '%c[小智服务] 在开发环境中,这是正常现象',
- 'color: #E6A23C; font-weight: bold;'
- );
- console.info('Service Worker通常只在生产环境中生效');
- console.info('要测试Service Worker功能:');
- console.info('1. 运行npm run build构建生产版本');
- console.info('2. 通过HTTP服务器访问构建后的页面');
- }
+ if (process.env.NODE_ENV === 'development') {
+ console.info(
+ '%c[' + this.$t('system.name') + '] ' + this.$t('cache.swDevEnvNormal'),
+ 'color: #E6A23C; font-weight: bold;'
+ );
+ console.info(this.$t('cache.swProdOnly'));
+ console.info(this.$t('cache.swTestingTitle'));
+ console.info('1. ' + this.$t('cache.swTestingStep1'));
+ console.info('2. ' + this.$t('cache.swTestingStep2'));
+ }
}
} catch (error) {
console.error('检查Service Worker状态失败:', error);
}
} else {
- console.warn('当前浏览器不支持Service Worker,CDN资源缓存功能不可用');
- }
+ console.warn(this.$t('cache.swNotSupported'));
+ }
}
}
};
diff --git a/main/manager-web/src/components/AddDeviceDialog.vue b/main/manager-web/src/components/AddDeviceDialog.vue
index b273a8dc..29b9cf30 100644
--- a/main/manager-web/src/components/AddDeviceDialog.vue
+++ b/main/manager-web/src/components/AddDeviceDialog.vue
@@ -6,24 +6,24 @@
style="width: 40px;height: 40px;border-radius: 50%;background: #5778ff;display: flex;align-items: center;justify-content: center;">
- 添加设备
+ {{ $t('device.dialogTitle') }}