Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Mar 23, 2024
1 parent 8e56429 commit c0dbc69
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
37 changes: 25 additions & 12 deletions entrypoints/popup/Popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ watch(isCheckTw5, (newValue, oldValue) => {
checkStatus()
} else {
// @ts-ignore
// 清空 status
status.value = ''
// ElMessage({
// message: '关闭 TiddlyWiki 5.x 检测',
Expand All @@ -122,8 +123,17 @@ watch(isCheckTw5, (newValue, oldValue) => {
}
})
const isChecking = ref(false)
function checkStatus() {
if (isChecking.value) {
ElMessage({
message: "正在检测中 ..."
})
return
}
fetch(`http://localhost:${port.value}/status`).then((res) => {
return res.json()
}).then((data) => {
Expand All @@ -138,16 +148,19 @@ function checkStatus() {
type: 'error'
})
} else {
// ElMessage({
// message: 'TiddlyWiki 连接成功',
// type: 'success'
// })
ElMessage({
message: 'TiddlyWiki 连接成功',
type: 'success'
})
}
}).catch((e) => {
ElMessage({
message: "TiddlyWiki 未成功连接" + e,
type: 'error'
})
// TODO: 这里总会提示报错,但是实际已经连接成功了
// ElMessage({
// message: "TiddlyWiki 未成功连接" + e,
// type: 'error'
// })
}).finally(() => {
isChecking.value = false
})
}
Expand Down Expand Up @@ -317,11 +330,11 @@ const save2TiddlyWiki = async (title: string, text: string, port: number, url: s
<ElTag>
{{ json.name.toUpperCase() }}: {{ json.version }}
</ElTag>
<ElButton>
<ElLink href="https://github.com/oeyoews/usewiki2" target="_blank">
<ElLink href="https://github.com/oeyoews/usewiki2" target="_blank">
<ElButton>
<CharmGithub />
</ElLink>
</ElButton>
</ElButton>
</ElLink>
</div>


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Usewiki2",
"name": "usewiki2",
"description": "manifest.json description",
"private": true,
"version": "0.0.9",
"version": "0.0.10",
"type": "module",
"scripts": {
"dev": "wxt",
Expand Down

0 comments on commit c0dbc69

Please sign in to comment.