新增功能:添加帮助文档入口,首次启动启动器时自动打开帮助文档
This commit is contained in:
parent
92ef815d0d
commit
f22594a260
7 changed files with 22 additions and 4 deletions
|
@ -19,6 +19,8 @@ class Total(ConfModel):
|
||||||
"""整体"""
|
"""整体"""
|
||||||
# 所在页面
|
# 所在页面
|
||||||
page: str = "init"
|
page: str = "init"
|
||||||
|
# 是否已展示帮助文档
|
||||||
|
is_already_show_doc: bool = False
|
||||||
|
|
||||||
|
|
||||||
class UpdatePart(ConfModel):
|
class UpdatePart(ConfModel):
|
||||||
|
|
|
@ -13,6 +13,8 @@ class SysConfig:
|
||||||
url: str
|
url: str
|
||||||
# 日志输出级别
|
# 日志输出级别
|
||||||
log_level: str
|
log_level: str
|
||||||
|
# 是否开启ui调试
|
||||||
|
debug: bool
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.config = {}
|
self.config = {}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": "v0.4",
|
"version": "v0.4",
|
||||||
"url": "ui/dist/index.html",
|
"url": "ui/dist/index.html",
|
||||||
"log_level": "ERROR"
|
"log_level": "ERROR",
|
||||||
|
"debug": false
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": "dev",
|
"version": "dev",
|
||||||
"url": "http://localhost:5173/",
|
"url": "http://localhost:5173/",
|
||||||
"log_level": "INFO"
|
"log_level": "INFO",
|
||||||
|
"debug": true
|
||||||
}
|
}
|
|
@ -10,4 +10,4 @@ def start_webview():
|
||||||
global window
|
global window
|
||||||
window = webview.create_window(f"mower-ng launcher {sys_config.get('version')}", sys_config.get('url'),
|
window = webview.create_window(f"mower-ng launcher {sys_config.get('version')}", sys_config.get('url'),
|
||||||
js_api=Api())
|
js_api=Api())
|
||||||
webview.start()
|
webview.start(debug=sys_config.get('debug'))
|
||||||
|
|
|
@ -12,6 +12,10 @@ const loading = ref(true)
|
||||||
const page = ref(null)
|
const page = ref(null)
|
||||||
let conf
|
let conf
|
||||||
|
|
||||||
|
function show_doc() {
|
||||||
|
window.open('https://hedgedoc.zhaozuohong.vip/s/LfSzK2n0K', '_blank')
|
||||||
|
}
|
||||||
|
|
||||||
async function init_version() {
|
async function init_version() {
|
||||||
version.value = await pywebview.api.get_version()
|
version.value = await pywebview.api.get_version()
|
||||||
new_version.value = await pywebview.api.get_new_version()
|
new_version.value = await pywebview.api.get_new_version()
|
||||||
|
@ -22,7 +26,11 @@ async function init_version() {
|
||||||
async function initialize_config() {
|
async function initialize_config() {
|
||||||
await configStore.load_config()
|
await configStore.load_config()
|
||||||
conf = configStore.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
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +103,9 @@ provide('new_version', new_version)
|
||||||
</template>
|
</template>
|
||||||
<settings />
|
<settings />
|
||||||
</n-tab-pane>
|
</n-tab-pane>
|
||||||
|
<template #suffix>
|
||||||
|
<n-button type="primary" secondary size="small" @click="show_doc">帮助文档</n-button>
|
||||||
|
</template>
|
||||||
</n-tabs>
|
</n-tabs>
|
||||||
</n-notification-provider>
|
</n-notification-provider>
|
||||||
<n-global-style />
|
<n-global-style />
|
||||||
|
|
|
@ -6,6 +6,7 @@ export const useConfigStore = defineStore('config', () => {
|
||||||
this.page = conf.page
|
this.page = conf.page
|
||||||
this.branch = conf.branch
|
this.branch = conf.branch
|
||||||
this.mirror = conf.mirror
|
this.mirror = conf.mirror
|
||||||
|
this.is_already_show_doc = conf.is_already_show_doc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue