Compare commits

...
2 Commits
Author SHA1 Message Date
fyears 1581cb3822 bump to 0.3.13 2022-03-23 22:57:16 +08:00
fyears 99926adbbd more hints for webdav 2022-03-23 22:56:42 +08:00
6 changed files with 33 additions and 21 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.3.12", "version": "0.3.13",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "remotely-save", "name": "remotely-save",
"version": "0.3.12", "version": "0.3.13",
"description": "This is yet another sync plugin for Obsidian app.", "description": "This is yet another sync plugin for Obsidian app.",
"scripts": { "scripts": {
"dev2": "node esbuild.config.mjs", "dev2": "node esbuild.config.mjs",
+9 -2
View File
@@ -1,5 +1,11 @@
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import { Vault, request, requestUrl, requireApiVersion } from "obsidian"; import {
Vault,
request,
requestUrl,
requireApiVersion,
Platform,
} from "obsidian";
import { Queue } from "@fyears/tsqueue"; import { Queue } from "@fyears/tsqueue";
import chunk from "lodash/chunk"; import chunk from "lodash/chunk";
@@ -20,7 +26,7 @@ import type {
ResponseDataDetailed, ResponseDataDetailed,
} from "webdav/web"; } from "webdav/web";
import { getPatcher } from "webdav/web"; import { getPatcher } from "webdav/web";
if (requireApiVersion(API_VER_REQURL)) { if (requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp) {
getPatcher().patch( getPatcher().patch(
"request", "request",
async ( async (
@@ -110,6 +116,7 @@ if (requireApiVersion(API_VER_REQURL)) {
// return r; // return r;
// }); // });
import { AuthType, BufferLike, createClient } from "webdav/web"; import { AuthType, BufferLike, createClient } from "webdav/web";
import { Plane } from "lucide";
export type { WebDAVClient } from "webdav/web"; export type { WebDAVClient } from "webdav/web";
export const DEFAULT_WEBDAV_CONFIG = { export const DEFAULT_WEBDAV_CONFIG = {
+20 -15
View File
@@ -1105,6 +1105,9 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
this.plugin.settings.serviceType !== "webdav" this.plugin.settings.serviceType !== "webdav"
); );
const webdavReq =
requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp;
webdavDiv.createEl("h2", { text: t("settings_webdav") }); webdavDiv.createEl("h2", { text: t("settings_webdav") });
webdavDiv.createEl("p", { webdavDiv.createEl("p", {
@@ -1112,7 +1115,17 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
cls: "webdav-disclaimer", cls: "webdav-disclaimer",
}); });
if (!requireApiVersion(API_VER_REQURL)) { if (!webdavReq) {
if (Platform.isAndroidApp) {
webdavDiv.createEl("p", {
text: t("settings_webdav_cors_android"),
});
} else {
webdavDiv.createEl("p", {
text: t("settings_webdav_cors_otheros"),
});
}
webdavDiv.createEl("p", { webdavDiv.createEl("p", {
text: t("settings_webdav_cors"), text: t("settings_webdav_cors"),
}); });
@@ -1168,15 +1181,12 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
.setDesc(t("settings_webdav_auth_desc")) .setDesc(t("settings_webdav_auth_desc"))
.addDropdown(async (dropdown) => { .addDropdown(async (dropdown) => {
dropdown.addOption("basic", "basic"); dropdown.addOption("basic", "basic");
if (requireApiVersion(API_VER_REQURL)) { if (webdavReq) {
dropdown.addOption("digest", "digest"); dropdown.addOption("digest", "digest");
} }
// new version config, copied to old version, we need to reset it // new version config, copied to old version, we need to reset it
if ( if (!webdavReq && this.plugin.settings.webdav.authType !== "basic") {
!requireApiVersion(API_VER_REQURL) &&
this.plugin.settings.webdav.authType !== "basic"
) {
this.plugin.settings.webdav.authType = "basic"; this.plugin.settings.webdav.authType = "basic";
await this.plugin.saveSettings(); await this.plugin.saveSettings();
} }
@@ -1249,16 +1259,11 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
if (res) { if (res) {
new Notice(t("settings_webdav_connect_succ")); new Notice(t("settings_webdav_connect_succ"));
} else { } else {
let corsErrMsg = "/CORS"; if (webdavReq) {
if (requireApiVersion(API_VER_REQURL)) { new Notice(t("settings_webdav_connect_fail"));
corsErrMsg = ""; } else {
new Notice(t("settings_webdav_connect_fail_withcors"));
} }
new Notice(
t("settings_webdav_connect_fail", {
corsErrMsg: corsErrMsg,
})
);
new Notice(errors.msg); new Notice(errors.msg);
} }
}); });
+1 -1
View File
@@ -1,4 +1,4 @@
{ {
"0.3.2": "0.12.15", "0.3.2": "0.12.15",
"0.3.12": "0.13.21" "0.3.13": "0.13.21"
} }