Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from terwer/release-please--branches--main--c…
…omponents--siyuan-plugin-picgo chore(main): release siyuan-plugin-picgo 1.6.0
- Loading branch information
Showing
36 changed files
with
503 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
".": "1.5.1" | ||
".": "1.6.0" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* GNU GENERAL PUBLIC LICENSE | ||
* Version 3, 29 June 2007 | ||
* | ||
* Copyright (C) 2024 Terwer, Inc. <https://terwer.space/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
|
||
import { SiyuanPicgoPostApi } from "./siyuanPicgoPostApi" | ||
import { SiyuanConfig, SiyuanKernelApi } from "zhi-siyuan-api" | ||
|
||
/** | ||
* 思源笔记 PicGo 实例 | ||
*/ | ||
class SiyuanPicGo { | ||
public static async getInstance(siyuanConfig: SiyuanConfig, isDev?: boolean): Promise<SiyuanPicgoPostApi> { | ||
return new Promise((resolve, _reject) => { | ||
const siyuanApi = new SiyuanKernelApi(siyuanConfig) | ||
const picgo = new SiyuanPicgoPostApi(siyuanConfig, isDev) | ||
|
||
let needUpdate = false | ||
const checkConfig = () => { | ||
if (picgo.cfgUpdating) { | ||
needUpdate = true | ||
siyuanApi.pushMsg({ | ||
msg: "检测到旧配置,正在迁移配置,请勿进行任何操作...", | ||
timeout: 1000, | ||
}) | ||
console.warn("检测到旧配置,正在迁移配置,请勿进行任何操作...") | ||
setTimeout(checkConfig, 1000) | ||
} else { | ||
if (needUpdate) { | ||
siyuanApi.pushMsg({ | ||
msg: "PicGO 图床历史配置迁移完成", | ||
timeout: 7000, | ||
}) | ||
console.log("PicGO 图床历史配置迁移完成") | ||
needUpdate = false | ||
} | ||
console.log("picgo instance is ready") | ||
resolve(picgo) | ||
} | ||
} | ||
checkConfig() | ||
}) | ||
} | ||
} | ||
|
||
export { SiyuanPicGo } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.