add koofr

This commit is contained in:
fyears
2024-06-15 23:06:41 +08:00
parent 689376adfe
commit a64b859e46
24 changed files with 11263 additions and 6 deletions
+24 -1
View File
@@ -23,6 +23,7 @@ import type {
import cloneDeep from "lodash/cloneDeep";
import { generateBoxSettingsPart } from "../pro/src/settingsBox";
import { generateGoogleDriveSettingsPart } from "../pro/src/settingsGoogleDrive";
import { generateKoofrSettingsPart } from "../pro/src/settingsKoofr";
import { generatePCloudSettingsPart } from "../pro/src/settingsPCloud";
import { generateProSettingsPart } from "../pro/src/settingsPro";
import { generateYandexDiskSettingsPart } from "../pro/src/settingsYandexDisk";
@@ -1862,6 +1863,15 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
() => this.plugin.saveSettings()
);
//////////////////////////////////////////////////
// below for koofr
//////////////////////////////////////////////////
const { koofrDiv, koofrAllowedToUsedDiv, koofrNotShowUpHintSetting } =
generateKoofrSettingsPart(containerEl, t, this.app, this.plugin, () =>
this.plugin.saveSettings()
);
//////////////////////////////////////////////////
// below for general chooser (part 2/2)
//////////////////////////////////////////////////
@@ -1887,6 +1897,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
"yandexdisk",
t("settings_chooseservice_yandexdisk")
);
dropdown.addOption("koofr", t("settings_chooseservice_koofr"));
dropdown
.setValue(this.plugin.settings.serviceType)
@@ -1928,6 +1939,10 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
"yandexdisk-hide",
this.plugin.settings.serviceType !== "yandexdisk"
);
koofrDiv.toggleClass(
"koofr-hide",
this.plugin.settings.serviceType !== "koofr"
);
await this.plugin.saveSettings();
});
});
@@ -2507,6 +2522,12 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
"yandexdisk"
).open();
});
})
.addButton(async (button) => {
button.setButtonText(t("settings_export_koofr_button"));
button.onClick(async () => {
new ExportSettingsQrCodeModal(this.app, this.plugin, "koofr").open();
});
});
let importSettingVal = "";
@@ -2579,7 +2600,9 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
pCloudAllowedToUsedDiv,
pCloudNotShowUpHintSetting,
yandexDiskAllowedToUsedDiv,
yandexDiskNotShowUpHintSetting
yandexDiskNotShowUpHintSetting,
koofrAllowedToUsedDiv,
koofrNotShowUpHintSetting
);
//////////////////////////////////////////////////