feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,47 @@
|
||||
import JoplinDatabase from '../JoplinDatabase';
|
||||
import Setting from '../models/Setting';
|
||||
import SyncTargetJoplinServer from '../SyncTargetJoplinServer';
|
||||
|
||||
export default class DebugService {
|
||||
|
||||
private db_: JoplinDatabase;
|
||||
|
||||
public constructor(db: JoplinDatabase) {
|
||||
this.db_ = db;
|
||||
}
|
||||
|
||||
private get db(): JoplinDatabase {
|
||||
return this.db_;
|
||||
}
|
||||
|
||||
public async clearSyncState() {
|
||||
const tableNames = [
|
||||
'item_changes',
|
||||
'deleted_items',
|
||||
'sync_items',
|
||||
'key_values',
|
||||
];
|
||||
|
||||
const queries = [];
|
||||
for (const n of tableNames) {
|
||||
queries.push(`DELETE FROM ${n}`);
|
||||
queries.push(`DELETE FROM sqlite_sequence WHERE name="${n}"`); // Reset autoincremented IDs
|
||||
}
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
queries.push(`DELETE FROM settings WHERE key="sync.${i}.context"`);
|
||||
queries.push(`DELETE FROM settings WHERE key="sync.${i}.auth"`);
|
||||
}
|
||||
|
||||
await this.db.transactionExecBatch(queries);
|
||||
}
|
||||
|
||||
public async setupJoplinServerUser(num: number) {
|
||||
const id = SyncTargetJoplinServer.id();
|
||||
Setting.setValue('sync.target', id);
|
||||
Setting.setValue(`sync.${id}.path`, 'http://localhost:22300');
|
||||
Setting.setValue(`sync.${id}.username`, `user${num}@example.com`);
|
||||
Setting.setValue(`sync.${id}.password`, '123456');
|
||||
}
|
||||
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户