diff --git a/launcher/config/conf.py b/launcher/config/conf.py
index 0f60eec..e411765 100644
--- a/launcher/config/conf.py
+++ b/launcher/config/conf.py
@@ -19,6 +19,8 @@ class Total(ConfModel):
"""整体"""
# 所在页面
page: str = "init"
+ # 是否已展示帮助文档
+ is_already_show_doc: bool = False
class UpdatePart(ConfModel):
diff --git a/launcher/sys_config/__init__.py b/launcher/sys_config/__init__.py
index 78115eb..f81abf3 100644
--- a/launcher/sys_config/__init__.py
+++ b/launcher/sys_config/__init__.py
@@ -13,6 +13,8 @@ class SysConfig:
url: str
# 日志输出级别
log_level: str
+ # 是否开启ui调试
+ debug: bool
def __init__(self):
self.config = {}
diff --git a/launcher/sys_config/config_dist.json b/launcher/sys_config/config_dist.json
index 01d4337..a9c2eb5 100644
--- a/launcher/sys_config/config_dist.json
+++ b/launcher/sys_config/config_dist.json
@@ -1,5 +1,6 @@
{
"version": "v0.4",
"url": "ui/dist/index.html",
- "log_level": "ERROR"
+ "log_level": "ERROR",
+ "debug": false
}
\ No newline at end of file
diff --git a/launcher/sys_config/config_local.json b/launcher/sys_config/config_local.json
index 8b1423e..d74400e 100644
--- a/launcher/sys_config/config_local.json
+++ b/launcher/sys_config/config_local.json
@@ -1,5 +1,6 @@
{
"version": "dev",
"url": "http://localhost:5173/",
- "log_level": "INFO"
+ "log_level": "INFO",
+ "debug": true
}
\ No newline at end of file
diff --git a/launcher/webview/__init__.py b/launcher/webview/__init__.py
index 77fe4a6..1129706 100644
--- a/launcher/webview/__init__.py
+++ b/launcher/webview/__init__.py
@@ -10,4 +10,4 @@ def start_webview():
global window
window = webview.create_window(f"mower-ng launcher {sys_config.get('version')}", sys_config.get('url'),
js_api=Api())
- webview.start()
+ webview.start(debug=sys_config.get('debug'))
diff --git a/ui/src/App.vue b/ui/src/App.vue
index be241cb..bba955f 100644
--- a/ui/src/App.vue
+++ b/ui/src/App.vue
@@ -12,6 +12,10 @@ const loading = ref(true)
const page = ref(null)
let conf
+function show_doc() {
+ window.open('https://hedgedoc.zhaozuohong.vip/s/LfSzK2n0K', '_blank')
+}
+
async function init_version() {
version.value = await pywebview.api.get_version()
new_version.value = await pywebview.api.get_new_version()
@@ -22,7 +26,11 @@ async function init_version() {
async function initialize_config() {
await configStore.load_config()
conf = configStore.config
- await init_version()
+ init_version()
+ if (!conf.is_already_show_doc) {
+ show_doc()
+ conf.is_already_show_doc = true
+ }
loading.value = false
}
@@ -95,6 +103,9 @@ provide('new_version', new_version)
+
+ 帮助文档
+
diff --git a/ui/src/stores/config.js b/ui/src/stores/config.js
index 8a7386d..f20625c 100644
--- a/ui/src/stores/config.js
+++ b/ui/src/stores/config.js
@@ -6,6 +6,7 @@ export const useConfigStore = defineStore('config', () => {
this.page = conf.page
this.branch = conf.branch
this.mirror = conf.mirror
+ this.is_already_show_doc = conf.is_already_show_doc
}
}