From d1b3d34c7af07b6c77ec388c1bfb516905aa39e6 Mon Sep 17 00:00:00 2001
From: li-xiaochen <397721316@qq.com>
Date: Sat, 30 Nov 2024 20:59:05 +0800
Subject: [PATCH] prettier format
---
ui/src/pages/Fix.vue | 55 ++++++++++++++----------
ui/src/pages/Settings.vue | 88 +++++++++++++++++++++------------------
2 files changed, 80 insertions(+), 63 deletions(-)
diff --git a/ui/src/pages/Fix.vue b/ui/src/pages/Fix.vue
index 73f5757..50190e8 100644
--- a/ui/src/pages/Fix.vue
+++ b/ui/src/pages/Fix.vue
@@ -3,39 +3,48 @@ const running = inject('running')
const notification = useNotification()
async function rm_site_packages_and_python_scripts() {
- running.value = true
- notification['info']({
- content: '提示',
- meta: '开始移除site-packages和python/Script目录',
- duration: 3000
- })
- const response = await pywebview.api.rm_site_packages()
- notification['info']({
- content: '提示',
- meta: response,
- duration: 3000
- })
- const response2 = await pywebview.api.rm_python_scripts()
- notification['info']({
- content: '提示',
- meta: response2,
- duration: 3000
- })
- running.value = false
+ running.value = true
+ notification['info']({
+ content: '提示',
+ meta: '开始移除site-packages和python/Script目录',
+ duration: 3000
+ })
+ const response = await pywebview.api.rm_site_packages()
+ notification['info']({
+ content: '提示',
+ meta: response,
+ duration: 3000
+ })
+ const response2 = await pywebview.api.rm_python_scripts()
+ notification['info']({
+ content: '提示',
+ meta: response2,
+ duration: 3000
+ })
+ running.value = false
}
-
-
- 移除 site-packages 和 python/Scripts 目录
+ "
+ >
+
+ 移除 site-packages 和 python/Scripts 目录
diff --git a/ui/src/pages/Settings.vue b/ui/src/pages/Settings.vue
index 6cb3b07..4798723 100644
--- a/ui/src/pages/Settings.vue
+++ b/ui/src/pages/Settings.vue
@@ -14,43 +14,45 @@ const check_running = ref(false)
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'])
- notification['error']({
- content: '错误',
- meta: response,
- duration: 3000
- })
- update_self_running.value = false
- running.value = false
+ running.value = true
+ update_self_running.value = true
+ const response = await pywebview.api.update_self(
+ new_version.value['assets'][0]['browser_download_url']
+ )
+ notification['error']({
+ content: '错误',
+ meta: response,
+ duration: 3000
+ })
+ update_self_running.value = false
+ running.value = false
}
async function open_new_version_html() {
- window.open(new_version.value['html_url'])
+ window.open(new_version.value['html_url'])
}
async function check_update() {
- running.value = true
- check_running.value = true
- new_version.value = await pywebview.api.get_new_version()
- if(new_version.value.tag_name > version.value){
- update_able.value = true
- notification['info']({
- content: '提示',
- meta: "有新版本可更新",
- duration: 3000
- })
- }else{
- update_able.value = false
- notification['info']({
- content: '提示',
- meta: "当前已是最新版本",
- duration: 3000
- })
- }
- check_running.value = false
- running.value = false
+ running.value = true
+ check_running.value = true
+ new_version.value = await pywebview.api.get_new_version()
+ if (new_version.value.tag_name > version.value) {
+ update_able.value = true
+ notification['info']({
+ content: '提示',
+ meta: '有新版本可更新',
+ duration: 3000
+ })
+ } else {
+ update_able.value = false
+ notification['info']({
+ content: '提示',
+ meta: '当前已是最新版本',
+ duration: 3000
+ })
+ }
+ check_running.value = false
+ running.value = false
}
@@ -59,8 +61,13 @@ async function check_update() {
- {{version}}
-
+ {{ version }}
+
@@ -68,17 +75,18 @@ async function check_update() {
-
+
- 最新版本:{{new_version.name}}
+ 最新版本:{{ new_version.name }}
了解此版本
-
+
立即更新