-
Notifications
You must be signed in to change notification settings - Fork 39
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
15 changed files
with
53 additions
and
61 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,12 +1,13 @@ | ||
import { Config, JoplinApiGenerator } from 'joplin-api' | ||
import { config, Config } from 'joplin-api' | ||
import { proxyStorage } from '@liuli-util/dom' | ||
|
||
export const joplinApiGenerator = new JoplinApiGenerator() | ||
const storage = proxyStorage<{ settings: Config }>(localStorage) | ||
joplinApiGenerator.token = storage.settings?.token ?? '' | ||
joplinApiGenerator.baseUrl = storage.settings?.baseUrl ?? 'http://localhost:41184' | ||
|
||
export function openNote(id: string) { | ||
const link = `joplin://x-callback-url/openNote?id=${id}` | ||
window.open(link) | ||
} | ||
|
||
export function init() { | ||
const storage = proxyStorage<{ settings: Config }>(localStorage) | ||
config.token = storage.settings?.token ?? '' | ||
config.baseUrl = storage.settings?.baseUrl ?? 'http://localhost:41184' | ||
} |
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
apps/joplin-batch-web/src/views/checkParentNotebook/service/CheckParentNotebookService.ts
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.home img { | ||
width: 100%; | ||
max-width: 980px; | ||
} |
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
7 changes: 3 additions & 4 deletions
7
...joplin-batch-web/src/views/unusedResource/service/__tests__/UnusedResourceService.test.ts
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,20 +1,19 @@ | ||
import { expect, it, describe } from 'vitest' | ||
import { PageUtil } from 'joplin-api' | ||
import { PageUtil, resourceApi } from 'joplin-api' | ||
import { UnusedResourceService } from '../UnusedResourceService' | ||
import { joplinApiGenerator } from '../../../../constants/joplinApiGenerator' | ||
|
||
describe('测试 UnusedResourceService', () => { | ||
describe('测试 joplin api', () => { | ||
it('测试 checkUsed', async () => { | ||
const unusedResourceService = new UnusedResourceService(joplinApiGenerator) | ||
const unusedResourceService = new UnusedResourceService() | ||
const usedId = '9a54a3b73dbc438aa65023e7b6f581c4' | ||
const unusedId = 'faf99736d4bd4a0b8d2b959887635f73' | ||
expect(await unusedResourceService.checkUsed(usedId)).toBeTruthy() | ||
expect(await unusedResourceService.checkUsed(unusedId)).toBeFalsy() | ||
}) | ||
}) | ||
it('测试获取所有附件资源', async () => { | ||
const list = await PageUtil.pageToAllList(joplinApiGenerator.resourceApi.list.bind(joplinApiGenerator.resourceApi)) | ||
const list = await PageUtil.pageToAllList(resourceApi.list.bind(resourceApi)) | ||
console.log(list) | ||
}) | ||
}) |