rename project

This commit is contained in:
fyears 2021-11-14 22:34:07 +08:00
parent 6459dcd228
commit 14f305adda
6 changed files with 30 additions and 28 deletions

View File

@ -1,10 +1,10 @@
# Save Remote # Remotely Save
This is yet another sync plugin for Obsidian. This is yet another unofficial sync plugin for Obsidian.
## Download and Install ## Download and Install
[![BuildCI](https://github.com/fyears/obsidian-save-remote/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/obsidian-save-remote/actions/workflows/auto-build.yml) [![BuildCI](https://github.com/fyears/obsidian-remotely-save/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/obsidian-remotely-save/actions/workflows/auto-build.yml)
Every artifacts are placed in the "Summary" under every successful builds. Every artifacts are placed in the "Summary" under every successful builds.

View File

@ -1,9 +1,9 @@
{ {
"id": "obsidian-save-remote", "id": "obsidian-remotely-Save",
"name": "Save remote", "name": "Remotely Save",
"version": "0.0.15", "version": "0.0.15",
"minAppVersion": "0.12.15", "minAppVersion": "0.12.15",
"description": "This is yet another plugin allowing users to sync notes between local device and the cloud.", "description": "Yet another unofficial plugin allowing users to sync notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
"authorUrl": "https://github.com/fyears", "authorUrl": "https://github.com/fyears",
"isDesktopOnly": false "isDesktopOnly": false

View File

@ -1,5 +1,5 @@
{ {
"name": "obsidian-save-remote", "name": "obsidian-remotely-save",
"version": "0.0.15", "version": "0.0.15",
"description": "This is yet another sync plugin for Obsidian app.", "description": "This is yet another sync plugin for Obsidian app.",
"scripts": { "scripts": {

View File

@ -5,7 +5,7 @@ import { readAllSyncPlanRecordTexts } from "./localdb";
import type { InternalDBs } from "./localdb"; import type { InternalDBs } from "./localdb";
import { mkdirpInVault } from "./misc"; import { mkdirpInVault } from "./misc";
const DEFAULT_DEBUG_FOLDER = "_debug_save_remote/"; const DEFAULT_DEBUG_FOLDER = "_debug_remotely_save/";
const DEFAULT_SYNC_PLANS_HISTORY_FILE_PREFIX = "sync_plans_hist_exported_on_"; const DEFAULT_SYNC_PLANS_HISTORY_FILE_PREFIX = "sync_plans_hist_exported_on_";
export const exportSyncPlansToFiles = async (db: InternalDBs, vault: Vault) => { export const exportSyncPlansToFiles = async (db: InternalDBs, vault: Vault) => {

View File

@ -7,7 +7,7 @@ import type { SyncPlanType } from "./sync";
export type LocalForage = typeof localforage; export type LocalForage = typeof localforage;
export const DEFAULT_DB_VERSION_NUMBER: number = 20211114; export const DEFAULT_DB_VERSION_NUMBER: number = 20211114;
export const DEFAULT_DB_NAME = "saveremotedb"; export const DEFAULT_DB_NAME = "remotelysavedb";
export const DEFAULT_TBL_VERSION = "schemaversion"; export const DEFAULT_TBL_VERSION = "schemaversion";
export const DEFAULT_TBL_DELETE_HISTORY = "filefolderoperationhistory"; export const DEFAULT_TBL_DELETE_HISTORY = "filefolderoperationhistory";
export const DEFAULT_TBL_SYNC_MAPPING = "syncmetadatahistory"; export const DEFAULT_TBL_SYNC_MAPPING = "syncmetadatahistory";

View File

@ -34,24 +34,24 @@ import {
} from "./s3"; } from "./s3";
import { exportSyncPlansToFiles } from "./debugMode"; import { exportSyncPlansToFiles } from "./debugMode";
interface SaveRemotePluginSettings { interface RemotelySavePluginSettings {
s3?: S3Config; s3?: S3Config;
password?: string; password?: string;
} }
const DEFAULT_SETTINGS: SaveRemotePluginSettings = { const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
s3: DEFAULT_S3_CONFIG, s3: DEFAULT_S3_CONFIG,
password: "", password: "",
}; };
export default class SaveRemotePlugin extends Plugin { export default class RemotelySavePlugin extends Plugin {
settings: SaveRemotePluginSettings; settings: RemotelySavePluginSettings;
cm: CodeMirror.Editor; cm: CodeMirror.Editor;
db: InternalDBs; db: InternalDBs;
syncStatus: SyncStatusType; syncStatus: SyncStatusType;
async onload() { async onload() {
console.log("loading plugin obsidian-save-remote"); console.log("loading plugin obsidian-remotely-save");
await this.loadSettings(); await this.loadSettings();
@ -71,15 +71,17 @@ export default class SaveRemotePlugin extends Plugin {
}) })
); );
this.addRibbonIcon("switch", "Save Remote", async () => { this.addRibbonIcon("switch", "Remotely Save", async () => {
if (this.syncStatus !== "idle") { if (this.syncStatus !== "idle") {
new Notice(`Save Remote already running in stage ${this.syncStatus}!`); new Notice(
`Remotely Save already running in stage ${this.syncStatus}!`
);
return; return;
} }
try { try {
//console.log(`huh ${this.settings.password}`) //console.log(`huh ${this.settings.password}`)
new Notice("1/6 Save Remote Sync Preparing"); new Notice("1/6 Remotely Save Sync Preparing");
this.syncStatus = "preparing"; this.syncStatus = "preparing";
new Notice("2/6 Starting to fetch remote meta data."); new Notice("2/6 Starting to fetch remote meta data.");
@ -121,7 +123,7 @@ export default class SaveRemotePlugin extends Plugin {
// The operations above are read only and kind of safe. // The operations above are read only and kind of safe.
// The operations below begins to write or delete (!!!) something. // The operations below begins to write or delete (!!!) something.
new Notice("6/7 Save Remote Sync data exchanging!"); new Notice("6/7 Remotely Save Sync data exchanging!");
this.syncStatus = "syncing"; this.syncStatus = "syncing";
await doActualSync( await doActualSync(
@ -133,11 +135,11 @@ export default class SaveRemotePlugin extends Plugin {
this.settings.password this.settings.password
); );
new Notice("7/7 Save Remote finish!"); new Notice("7/7 Remotely Save finish!");
this.syncStatus = "finish"; this.syncStatus = "finish";
this.syncStatus = "idle"; this.syncStatus = "idle";
} catch (error) { } catch (error) {
const msg = `Save Remote error while ${this.syncStatus}`; const msg = `Remotely Save error while ${this.syncStatus}`;
console.log(msg); console.log(msg);
console.log(error); console.log(error);
new Notice(msg); new Notice(msg);
@ -146,7 +148,7 @@ export default class SaveRemotePlugin extends Plugin {
} }
}); });
this.addSettingTab(new SaveRemoteSettingTab(this.app, this)); this.addSettingTab(new RemotelySaveSettingTab(this.app, this));
this.registerCodeMirror((cm: CodeMirror.Editor) => { this.registerCodeMirror((cm: CodeMirror.Editor) => {
this.cm = cm; this.cm = cm;
@ -163,7 +165,7 @@ export default class SaveRemotePlugin extends Plugin {
} }
onunload() { onunload() {
console.log("unloading plugin obsidian-save-remote"); console.log("unloading plugin obsidian-remotely-save");
this.destroyDBs(); this.destroyDBs();
} }
@ -185,9 +187,9 @@ export default class SaveRemotePlugin extends Plugin {
} }
export class PasswordModal extends Modal { export class PasswordModal extends Modal {
plugin: SaveRemotePlugin; plugin: RemotelySavePlugin;
newPassword: string; newPassword: string;
constructor(app: App, plugin: SaveRemotePlugin, newPassword: string) { constructor(app: App, plugin: RemotelySavePlugin, newPassword: string) {
super(app); super(app);
this.plugin = plugin; this.plugin = plugin;
this.newPassword = newPassword; this.newPassword = newPassword;
@ -242,10 +244,10 @@ export class PasswordModal extends Modal {
} }
} }
class SaveRemoteSettingTab extends PluginSettingTab { class RemotelySaveSettingTab extends PluginSettingTab {
plugin: SaveRemotePlugin; plugin: RemotelySavePlugin;
constructor(app: App, plugin: SaveRemotePlugin) { constructor(app: App, plugin: RemotelySavePlugin) {
super(app, plugin); super(app, plugin);
this.plugin = plugin; this.plugin = plugin;
} }
@ -255,7 +257,7 @@ class SaveRemoteSettingTab extends PluginSettingTab {
containerEl.empty(); containerEl.empty();
containerEl.createEl("h1", { text: "Save Remote" }); containerEl.createEl("h1", { text: "Remotely Save" });
const s3Div = containerEl.createEl("div"); const s3Div = containerEl.createEl("div");
s3Div.createEl("h2", { text: "S3 (-compatible) Service" }); s3Div.createEl("h2", { text: "S3 (-compatible) Service" });