half way of encryption refactor

This commit is contained in:
fyears
2024-03-23 16:38:58 +08:00
parent 98380b6c92
commit 6825241071
16 changed files with 322 additions and 207 deletions
+23
View File
@@ -22,6 +22,7 @@ import {
VALID_REQURL,
WebdavAuthType,
WebdavDepthType,
CipherMethodType,
} from "./baseTypes";
import { exportVaultSyncPlansToFiles } from "./debugMode";
import { exportQrCodeUri } from "./importExport";
@@ -1634,6 +1635,28 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
});
});
new Setting(basicDiv)
.setName(t("settings_encryptionmethod"))
.setDesc(t("settings_encryptionmethod_desc"))
.addDropdown((dropdown) => {
dropdown.addOption("rclone", t("settings_encryptionmethod_rclone"));
dropdown.addOption("openssl", t("settings_encryptionmethod_openssl"));
if (this.plugin.settings.encryptionMethod === "rclone-base64") {
dropdown.setValue("rclone");
} else if (this.plugin.settings.encryptionMethod === "openssl-base64") {
dropdown.setValue("openssl");
}
dropdown.onChange(async (val: string) => {
if (val === "rclone") {
this.plugin.settings.encryptionMethod = "rclone-base64";
} else if (val === "openssl") {
this.plugin.settings.encryptionMethod = "openssl-base64";
}
await this.plugin.saveSettings();
});
});
new Setting(basicDiv)
.setName(t("settings_autorun"))
.setDesc(t("settings_autorun_desc"))