Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
166 additions
and
62 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
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
7 changes: 3 additions & 4 deletions
7
packages/picgo-plugin-app/src/components/test/BrowserTest.vue
Large diffs are not rendered by default.
Oops, something went wrong.
20 changes: 10 additions & 10 deletions
20
packages/picgo-plugin-app/src/components/test/ElectronTest.vue
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* 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 { SiyuanPicGoUploadApi } from "universal-picgo" | ||
import { isDev } from "@/utils/Constants.ts" | ||
import { ElMessage } from "element-plus" | ||
import { createAppLogger } from "@/utils/appLogger.ts" | ||
|
||
/** | ||
* 思源笔记 PicGp 实例 | ||
*/ | ||
class SiyuanPicGo { | ||
private static logger = createAppLogger("siyuan-pigo") | ||
|
||
public static async getInstance(): Promise<SiyuanPicGoUploadApi> { | ||
return new Promise((resolve, reject) => { | ||
const picgo = new SiyuanPicGoUploadApi(isDev) | ||
const checkConfig = () => { | ||
if (picgo.cfgUpdating) { | ||
ElMessage.warning("检测到旧配置,正在迁移配置,请勿进行任何操作...") | ||
setTimeout(checkConfig, 1000) | ||
} else { | ||
this.logger.info("picgo instance is ready") | ||
ElMessage.success("配置迁移完成") | ||
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