prettier format

This commit is contained in:
li-xiaochen 2024-11-30 20:59:05 +08:00
parent 8fd5b4c6e5
commit d1b3d34c7a
2 changed files with 80 additions and 63 deletions

View file

@ -26,15 +26,24 @@ async function rm_site_packages_and_python_scripts() {
</script>
<template>
<n-flex vertical style="
<n-flex
vertical
style="
gap: 16px;
height: 100%;
padding: 16px;
box-sizing: border-box;
justify-content: center;
align-items: center;
">
<n-button class="fix-btn" type="error" secondary size="large" @click="rm_site_packages_and_python_scripts">
"
>
<n-button
class="fix-btn"
type="error"
secondary
size="large"
@click="rm_site_packages_and_python_scripts"
>
移除 site-packages python/Scripts 目录
</n-button>
</n-flex>

View file

@ -16,7 +16,9 @@ const update_self_running = ref(false)
async function update_self() {
running.value = true
update_self_running.value = true
const response = await pywebview.api.update_self(new_version.value['assets'][0]['browser_download_url'])
const response = await pywebview.api.update_self(
new_version.value['assets'][0]['browser_download_url']
)
notification['error']({
content: '错误',
meta: response,
@ -38,14 +40,14 @@ async function check_update() {
update_able.value = true
notification['info']({
content: '提示',
meta: "有新版本可更新",
meta: '有新版本可更新',
duration: 3000
})
} else {
update_able.value = false
notification['info']({
content: '提示',
meta: "当前已是最新版本",
meta: '当前已是最新版本',
duration: 3000
})
}
@ -60,7 +62,12 @@ async function check_update() {
<n-form-item label="版本">
<n-space align="center">
{{ version }}
<n-button type="success" :loading="check_running" :disabled="running" @click="check_update">
<n-button
type="success"
:loading="check_running"
:disabled="running"
@click="check_update"
>
<template #icon>
<n-icon :component="SyncCircle"></n-icon>
</template>
@ -68,17 +75,18 @@ async function check_update() {
</n-button>
</n-space>
</n-form-item>
<n-alert
style="margin: 8px 0"
type="success"
v-if="update_able"
>
<n-alert style="margin: 8px 0" type="success" v-if="update_able">
<template #header>
最新版本{{ new_version.name }}
<n-button style="float: right" @click="open_new_version_html">了解此版本</n-button>
</template>
<n-space>
<n-button type="success" :loading="update_self_running" :disabled="running" @click="update_self">
<n-button
type="success"
:loading="update_self_running"
:disabled="running"
@click="update_self"
>
立即更新
</n-button>
</n-space>