mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
hide webdav yet
This commit is contained in:
parent
e82dfc1e88
commit
52e9d3298a
38
src/main.ts
38
src/main.ts
@ -36,6 +36,7 @@ interface RemotelySavePluginSettings {
|
|||||||
webdav: WebdavConfig;
|
webdav: WebdavConfig;
|
||||||
password: string;
|
password: string;
|
||||||
serviceType: SUPPORTED_SERVICES_TYPE;
|
serviceType: SUPPORTED_SERVICES_TYPE;
|
||||||
|
enableExperimentService: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
|
const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
|
||||||
@ -43,6 +44,7 @@ const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
|
|||||||
webdav: DEFAULT_WEBDAV_CONFIG,
|
webdav: DEFAULT_WEBDAV_CONFIG,
|
||||||
password: "",
|
password: "",
|
||||||
serviceType: "s3",
|
serviceType: "s3",
|
||||||
|
enableExperimentService: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class RemotelySavePlugin extends Plugin {
|
export default class RemotelySavePlugin extends Plugin {
|
||||||
@ -294,6 +296,28 @@ class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
// we need to create the div in advance of s3Div and webdavDiv
|
// we need to create the div in advance of s3Div and webdavDiv
|
||||||
const serviceChooserDiv = generalDiv.createEl("div");
|
const serviceChooserDiv = generalDiv.createEl("div");
|
||||||
|
|
||||||
|
serviceChooserDiv.onClickEvent((x) => {
|
||||||
|
if (x.detail === 5) {
|
||||||
|
if (this.plugin.settings.serviceType === "webdav") {
|
||||||
|
new Notice(
|
||||||
|
"You've enabled hidden unstable experimental webdav support before. Nothing changes."
|
||||||
|
);
|
||||||
|
} else if (!this.plugin.settings.enableExperimentService) {
|
||||||
|
this.plugin.settings.enableExperimentService = true;
|
||||||
|
this.plugin.saveSettings();
|
||||||
|
new Notice(
|
||||||
|
"You've enabled hidden unstable experimental webdav support. Reopen settings again and try webdav with caution."
|
||||||
|
);
|
||||||
|
} else if (this.plugin.settings.enableExperimentService) {
|
||||||
|
this.plugin.settings.enableExperimentService = false;
|
||||||
|
this.plugin.saveSettings();
|
||||||
|
new Notice(
|
||||||
|
"You've disabled hidden unstable experimental webdav support. Reopen settings again."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const s3Div = containerEl.createEl("div", { cls: "s3-hide" });
|
const s3Div = containerEl.createEl("div", { cls: "s3-hide" });
|
||||||
s3Div.toggleClass("s3-hide", this.plugin.settings.serviceType !== "s3");
|
s3Div.toggleClass("s3-hide", this.plugin.settings.serviceType !== "s3");
|
||||||
s3Div.createEl("h2", { text: "S3 (-compatible) Service" });
|
s3Div.createEl("h2", { text: "S3 (-compatible) Service" });
|
||||||
@ -523,8 +547,18 @@ class RemotelySaveSettingTab extends PluginSettingTab {
|
|||||||
.setName("Choose service")
|
.setName("Choose service")
|
||||||
.setDesc("Choose a service, by default s3")
|
.setDesc("Choose a service, by default s3")
|
||||||
.addDropdown(async (dropdown) => {
|
.addDropdown(async (dropdown) => {
|
||||||
dropdown.addOption("s3", "s3 (more mature)");
|
const currService = this.plugin.settings.serviceType;
|
||||||
dropdown.addOption("webdav", "webdav (experimental)");
|
const enableExperimentService =
|
||||||
|
this.plugin.settings.enableExperimentService;
|
||||||
|
|
||||||
|
dropdown.addOption("s3", "s3 (-compatible)");
|
||||||
|
if (currService === "webdav" || enableExperimentService) {
|
||||||
|
dropdown.addOption("webdav", "webdav (experimental)");
|
||||||
|
if (!enableExperimentService) {
|
||||||
|
this.plugin.settings.enableExperimentService = true;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
dropdown
|
dropdown
|
||||||
.setValue(this.plugin.settings.serviceType)
|
.setValue(this.plugin.settings.serviceType)
|
||||||
.onChange(async (val: SUPPORTED_SERVICES_TYPE) => {
|
.onChange(async (val: SUPPORTED_SERVICES_TYPE) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user