From 978e77660dfe5dfd5a241510d8ddba1889ffac25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com>
Date: Mon, 28 Oct 2024 00:14:28 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E6=8C=89=E9=9C=80=E7=9A=84=E5=9C=A8?=
=?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A1=B6=E6=A0=8F=E6=98=BE=E7=A4=BA=E9=9C=80?=
=?UTF-8?q?=E8=A6=81=E9=87=8D=E5=90=AF=20Vite=20=E7=83=AD=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E6=9C=8D=E5=8A=A1=E7=9A=84=E8=AD=A6=E5=91=8A=E6=8C=89?=
=?UTF-8?q?=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/App.vue | 2 +
web/src/lang/backend/en.ts | 14 ++
web/src/lang/backend/en/module.ts | 5 +
web/src/lang/backend/zh-cn.ts | 13 ++
web/src/lang/backend/zh-cn/module.ts | 4 +
.../layouts/backend/components/navMenus.vue | 86 ++++++++++--
web/src/utils/vite.ts | 129 ++++++++++++++----
.../backend/module/components/commonDone.vue | 48 +++++--
8 files changed, 251 insertions(+), 50 deletions(-)
diff --git a/web/src/App.vue b/web/src/App.vue
index b94d4e33..56e6a15f 100644
--- a/web/src/App.vue
+++ b/web/src/App.vue
@@ -10,6 +10,7 @@ import { useRoute } from 'vue-router'
import { useConfig } from '/@/stores/config'
import { setTitleFromRoute } from '/@/utils/common'
import iconfontInit from '/@/utils/iconfont'
+import { init as viteInit } from '/@/utils/vite'
// modules import mark, Please do not remove.
const route = useRoute()
@@ -19,6 +20,7 @@ const config = useConfig()
const { getLocaleMessage } = useI18n()
const lang = getLocaleMessage(config.lang.defaultLang) as any
onMounted(() => {
+ viteInit()
iconfontInit()
// Modules onMounted mark, Please do not remove.
diff --git a/web/src/lang/backend/en.ts b/web/src/lang/backend/en.ts
index fdc6ded8..b5a00cd2 100644
--- a/web/src/lang/backend/en.ts
+++ b/web/src/lang/backend/en.ts
@@ -74,4 +74,18 @@ export default {
'Newly added tasks will never start because they are blocked by failed tasks!(Web terminal)',
'Failed to modify the source command, Please try again manually': 'Failed to modify the source command. Please try again manually.',
},
+ vite: {
+ Later: '稍后',
+ 'Restart hot update': '重启热更新',
+ 'Close type terminal': 'WEB Terminal server',
+ 'Close type crud': 'CRUD server',
+ 'Close type modules': 'module install server',
+ 'Close type config': 'system configuration server',
+ 'Reload hot server title': 'Need to restart Vite hot update service',
+ 'Reload hot server tips 1': 'To ensure that ',
+ 'Reload hot server tips 2':
+ " is not interrupted, the system has temporarily suspended Vite's hot update function. During this period, changes to front-end files will not be updated in real-time and web pages will not be automatically reloaded. It has been detected that there are file updates during the service suspension period, and the hot update service needs to be restarted.",
+ 'Reload hot server tips 3':
+ 'The pause of hot updates does not affect the already loaded functions. You can continue to operate and click to restart the hot update service after everything is ready.',
+ },
}
diff --git a/web/src/lang/backend/en/module.ts b/web/src/lang/backend/en/module.ts
index 1ac1fba2..cd4a333e 100644
--- a/web/src/lang/backend/en/module.ts
+++ b/web/src/lang/backend/en/module.ts
@@ -156,4 +156,9 @@ export default {
'Wait for installation': 'Wait for installation',
'Conflict pending': 'Conflict pending',
'Dependency to be installed': 'Dependency to be installed',
+ 'Restart Vite hot server': 'Restart Vite hot server',
+ 'Restart Vite hot server tips':
+ 'Before successfully restarting the service, you can find the button to manually restart the service from the button group on the right side of the top bar.',
+ 'Manual restart': 'Manual restart',
+ 'Restart Now': 'Restart Now',
}
diff --git a/web/src/lang/backend/zh-cn.ts b/web/src/lang/backend/zh-cn.ts
index d597fe26..4d76c356 100644
--- a/web/src/lang/backend/zh-cn.ts
+++ b/web/src/lang/backend/zh-cn.ts
@@ -74,4 +74,17 @@ export default {
'Newly added tasks will never start because they are blocked by failed tasks': '新添加的任务永远不会开始,因为被失败的任务阻塞!(WEB终端)',
'Failed to modify the source command, Please try again manually': '修改源的命令执行失败,请手动重试。',
},
+ vite: {
+ Later: '稍后',
+ 'Restart hot update': '重启热更新',
+ 'Close type terminal': 'WEB终端执行命令',
+ 'Close type crud': 'CRUD代码生成服务',
+ 'Close type modules': '模块安装服务',
+ 'Close type config': '修改系统配置',
+ 'Reload hot server title': '需要重启 Vite 热更新服务',
+ 'Reload hot server tips 1': '为确保',
+ 'Reload hot server tips 2':
+ '不被打断,系统暂停了 Vite 的热更新功能,期间前端文件变动将不会实时更新和自动重载网页,现检测到服务暂停期间存在文件更新,需要重启热更新服务。',
+ 'Reload hot server tips 3': '热更新暂停不影响已经加载好的功能,您可以继续操作,并在一切就绪后再点击重新启动热更新服务。',
+ },
}
diff --git a/web/src/lang/backend/zh-cn/module.ts b/web/src/lang/backend/zh-cn/module.ts
index 41fa09ca..018dbc1f 100644
--- a/web/src/lang/backend/zh-cn/module.ts
+++ b/web/src/lang/backend/zh-cn/module.ts
@@ -148,4 +148,8 @@ export default {
'Wait for installation': '等待安装',
'Conflict pending': '冲突待处理',
'Dependency to be installed': '依赖待安装',
+ 'Restart Vite hot server': '重启 Vite 热更新服务',
+ 'Restart Vite hot server tips': '在完成服务重启之前,您可以随时从顶栏右侧的按钮组中找到手动重启服务的按钮。',
+ 'Manual restart': '手动重启',
+ 'Restart Now': '立即重启',
}
diff --git a/web/src/layouts/backend/components/navMenus.vue b/web/src/layouts/backend/components/navMenus.vue
index 1ec2c086..292dcaf2 100644
--- a/web/src/layouts/backend/components/navMenus.vue
+++ b/web/src/layouts/backend/components/navMenus.vue
@@ -1,10 +1,43 @@
+
+
+