新增功能:启动程序和设置页面添加日志窗口

This commit is contained in:
li-xiaochen 2025-01-25 17:41:01 +08:00
parent 9295d9f2cf
commit cae312a272
5 changed files with 55 additions and 53 deletions

View file

@ -1,4 +1,8 @@
<script setup>
import { useConfigStore } from '@/stores/config.js'
import { form_item_label_style } from '@/styles/styles.js'
const conf = useConfigStore().config
function webview() {
pywebview.api.run('webview', 'mower-ng')
}
@ -9,23 +13,16 @@ function manager() {
</script>
<template>
<n-flex
vertical
style="
gap: 16px;
height: 100%;
padding: 16px;
box-sizing: border-box;
justify-content: center;
align-items: center;
"
>
<n-button class="launch-btn" type="primary" secondary size="large" @click="webview">
单开运行
</n-button>
<n-button class="launch-btn" type="primary" secondary size="large" @click="manager">
多开器
</n-button>
<n-flex vertical style="gap: 16px; height: 100%; padding: 16px; box-sizing: border-box">
<n-form label-placement="left" :show-feedback="false" label-width="auto" label-align="left">
<n-form-item label="启动程序" :label-style="form_item_label_style">
<n-space size="large">
<n-button class="launch-btn" type="primary" secondary size="large" @click="webview"> 单开运行 </n-button>
<n-button class="launch-btn" type="primary" secondary size="large" @click="manager"> 多开器 </n-button>
</n-space>
</n-form-item>
</n-form>
<log-component />
</n-flex>
</template>
@ -34,4 +31,4 @@ function manager() {
width: 120px;
height: 48px;
}
</style>
</style>

View file

@ -91,5 +91,6 @@ async function check_update() {
</n-space>
</n-alert>
</n-form>
<log-component />
</n-flex>
</template>

View file

@ -3,10 +3,12 @@ import { defineStore } from 'pinia'
export const useConfigStore = defineStore('config', () => {
class Config {
constructor(conf) {
// 整体 Total
this.page = conf.page
this.is_already_show_doc = conf.is_already_show_doc
// 更新代码 UpdatePart
this.branch = conf.branch
this.mirror = conf.mirror
this.is_already_show_doc = conf.is_already_show_doc
}
}