mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 17:55:56 +00:00
run prettier and update lib
This commit is contained in:
2
src/lib
2
src/lib
Submodule src/lib updated: 90ace6de16...d94133d964
@@ -93,9 +93,12 @@ export class ModuleCheckRemoteSize extends AbstractModule implements ICoreModule
|
||||
LOG_LEVEL_INFO
|
||||
);
|
||||
} else {
|
||||
this._log($msg("moduleCheckRemoteSize.logCurrentStorageSize", {
|
||||
this._log(
|
||||
$msg("moduleCheckRemoteSize.logCurrentStorageSize", {
|
||||
measuredSize: sizeToHumanReadable(estimatedSize),
|
||||
}), LOG_LEVEL_INFO);
|
||||
}),
|
||||
LOG_LEVEL_INFO
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { $msg } from "src/lib/src/common/i18n.ts";
|
||||
export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
async migrateDisableBulkSend() {
|
||||
if (this.settings.sendChunksBulk) {
|
||||
this._log($msg('moduleMigration.logBulkSendCorrupted'), LOG_LEVEL_NOTICE);
|
||||
this._log($msg("moduleMigration.logBulkSendCorrupted"), LOG_LEVEL_NOTICE);
|
||||
this.settings.sendChunksBulk = false;
|
||||
this.settings.sendChunksBulkMaxSize = 1;
|
||||
await this.saveSettings();
|
||||
@@ -24,10 +24,13 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// Check each migrations(old -> current)
|
||||
if (!(await this.migrateToCaseInsensitive(old, current))) {
|
||||
this._log($msg('moduleMigration.logMigrationFailed', {
|
||||
this._log(
|
||||
$msg("moduleMigration.logMigrationFailed", {
|
||||
old: old.toString(),
|
||||
current: current.toString()
|
||||
}), LOG_LEVEL_NOTICE);
|
||||
current: current.toString(),
|
||||
}),
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -67,10 +70,10 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
remoteChecked = true;
|
||||
}
|
||||
} else {
|
||||
this._log($msg('moduleMigration.logFetchRemoteTweakFailed'), LOG_LEVEL_INFO);
|
||||
this._log($msg("moduleMigration.logFetchRemoteTweakFailed"), LOG_LEVEL_INFO);
|
||||
}
|
||||
} catch (ex) {
|
||||
this._log($msg('moduleMigration.logRemoteTweakUnavailable'), LOG_LEVEL_INFO);
|
||||
this._log($msg("moduleMigration.logRemoteTweakUnavailable"), LOG_LEVEL_INFO);
|
||||
this._log(ex, LOG_LEVEL_VERBOSE);
|
||||
}
|
||||
|
||||
@@ -81,18 +84,21 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
this.settings.handleFilenameCaseSensitive = true;
|
||||
this.settings.doNotUseFixedRevisionForChunks = true;
|
||||
this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
this._log($msg('moduleMigration.logMigratedSameBehaviour', {
|
||||
current: current.toString()
|
||||
}), LOG_LEVEL_INFO);
|
||||
this._log(
|
||||
$msg("moduleMigration.logMigratedSameBehaviour", {
|
||||
current: current.toString(),
|
||||
}),
|
||||
LOG_LEVEL_INFO
|
||||
);
|
||||
await this.saveSettings();
|
||||
return true;
|
||||
}
|
||||
const message = $msg('moduleMigration.msgFetchRemoteAgain');
|
||||
const OPTION_FETCH = $msg('moduleMigration.optionYesFetchAgain');
|
||||
const DISMISS = $msg('moduleMigration.optionNoAskAgain');
|
||||
const message = $msg("moduleMigration.msgFetchRemoteAgain");
|
||||
const OPTION_FETCH = $msg("moduleMigration.optionYesFetchAgain");
|
||||
const DISMISS = $msg("moduleMigration.optionNoAskAgain");
|
||||
const options = [OPTION_FETCH, DISMISS];
|
||||
const ret = await this.core.confirm.confirmWithMessage(
|
||||
$msg('moduleMigration.titleCaseSensitivity'),
|
||||
$msg("moduleMigration.titleCaseSensitivity"),
|
||||
message,
|
||||
options,
|
||||
DISMISS,
|
||||
@@ -107,7 +113,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
await this.core.rebuilder.scheduleFetch();
|
||||
return;
|
||||
} catch (ex) {
|
||||
this._log($msg('moduleMigration.logRedflag2CreationFail'), LOG_LEVEL_VERBOSE);
|
||||
this._log($msg("moduleMigration.logRedflag2CreationFail"), LOG_LEVEL_VERBOSE);
|
||||
this._log(ex, LOG_LEVEL_VERBOSE);
|
||||
}
|
||||
return false;
|
||||
@@ -116,19 +122,25 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
}
|
||||
}
|
||||
|
||||
const ENABLE_BOTH = $msg('moduleMigration.optionEnableBoth');
|
||||
const ENABLE_FILENAME_CASE_INSENSITIVE = $msg('moduleMigration.optionEnableFilenameCaseInsensitive');
|
||||
const ENABLE_FIXED_REVISION_FOR_CHUNKS = $msg('moduleMigration.optionEnableFixedRevisionForChunks');
|
||||
const ADJUST_TO_REMOTE = $msg('moduleMigration.optionAdjustRemote');
|
||||
const KEEP = $msg('moduleMigration.optionKeepPreviousBehaviour');
|
||||
const DISMISS = $msg('moduleMigration.optionDecideLater');
|
||||
const message = $msg('moduleMigration.msgSinceV02321');
|
||||
const ENABLE_BOTH = $msg("moduleMigration.optionEnableBoth");
|
||||
const ENABLE_FILENAME_CASE_INSENSITIVE = $msg("moduleMigration.optionEnableFilenameCaseInsensitive");
|
||||
const ENABLE_FIXED_REVISION_FOR_CHUNKS = $msg("moduleMigration.optionEnableFixedRevisionForChunks");
|
||||
const ADJUST_TO_REMOTE = $msg("moduleMigration.optionAdjustRemote");
|
||||
const KEEP = $msg("moduleMigration.optionKeepPreviousBehaviour");
|
||||
const DISMISS = $msg("moduleMigration.optionDecideLater");
|
||||
const message = $msg("moduleMigration.msgSinceV02321");
|
||||
const options = [ENABLE_BOTH, ENABLE_FILENAME_CASE_INSENSITIVE, ENABLE_FIXED_REVISION_FOR_CHUNKS];
|
||||
if (remoteChecked) {
|
||||
options.push(ADJUST_TO_REMOTE);
|
||||
}
|
||||
options.push(KEEP, DISMISS);
|
||||
const ret = await this.core.confirm.confirmWithMessage($msg('moduleMigration.titleCaseSensitivity'), message, options, DISMISS, 40);
|
||||
const ret = await this.core.confirm.confirmWithMessage(
|
||||
$msg("moduleMigration.titleCaseSensitivity"),
|
||||
message,
|
||||
options,
|
||||
DISMISS,
|
||||
40
|
||||
);
|
||||
console.dir(ret);
|
||||
switch (ret) {
|
||||
case ENABLE_BOTH:
|
||||
@@ -160,14 +172,14 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
}
|
||||
|
||||
async initialMessage() {
|
||||
const message = $msg('moduleMigration.msgInitialSetup', {
|
||||
URI_DOC: $msg('moduleMigration.docUri'),
|
||||
const message = $msg("moduleMigration.msgInitialSetup", {
|
||||
URI_DOC: $msg("moduleMigration.docUri"),
|
||||
});
|
||||
const USE_SETUP = $msg('moduleMigration.optionHaveSetupUri');
|
||||
const NEXT = $msg('moduleMigration.optionNoSetupUri');
|
||||
const USE_SETUP = $msg("moduleMigration.optionHaveSetupUri");
|
||||
const NEXT = $msg("moduleMigration.optionNoSetupUri");
|
||||
|
||||
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_SETUP, NEXT], {
|
||||
title: $msg('moduleMigration.titleWelcome'),
|
||||
title: $msg("moduleMigration.titleWelcome"),
|
||||
defaultAction: USE_SETUP,
|
||||
});
|
||||
if (ret === USE_SETUP) {
|
||||
@@ -180,13 +192,13 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
}
|
||||
|
||||
async askAgainForSetupURI() {
|
||||
const message = $msg('moduleMigration.msgRecommendSetupUri', { URI_DOC: $msg('moduleMigration.docUri') });
|
||||
const USE_MINIMAL = $msg('moduleMigration.optionSetupWizard');
|
||||
const USE_SETUP = $msg('moduleMigration.optionManualSetup');
|
||||
const NEXT = $msg('moduleMigration.optionRemindNextLaunch');
|
||||
const message = $msg("moduleMigration.msgRecommendSetupUri", { URI_DOC: $msg("moduleMigration.docUri") });
|
||||
const USE_MINIMAL = $msg("moduleMigration.optionSetupWizard");
|
||||
const USE_SETUP = $msg("moduleMigration.optionManualSetup");
|
||||
const NEXT = $msg("moduleMigration.optionRemindNextLaunch");
|
||||
|
||||
const ret = await this.core.confirm.askSelectStringDialogue(message, [USE_MINIMAL, USE_SETUP, NEXT], {
|
||||
title: $msg('moduleMigration.titleRecommendSetupUri'),
|
||||
title: $msg("moduleMigration.titleRecommendSetupUri"),
|
||||
defaultAction: USE_MINIMAL,
|
||||
});
|
||||
if (ret === USE_MINIMAL) {
|
||||
@@ -204,7 +216,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
|
||||
async $everyOnFirstInitialize(): Promise<boolean> {
|
||||
if (!this.localDatabase.isReady) {
|
||||
this._log($msg('moduleMigration.logLocalDatabaseNotReady'), LOG_LEVEL_NOTICE);
|
||||
this._log($msg("moduleMigration.logLocalDatabaseNotReady"), LOG_LEVEL_NOTICE);
|
||||
return false;
|
||||
}
|
||||
if (this.settings.isConfigured) {
|
||||
@@ -214,7 +226,7 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
if (!this.settings.isConfigured) {
|
||||
// Case sensitivity
|
||||
if (!(await this.initialMessage()) || !(await this.askAgainForSetupURI())) {
|
||||
this._log($msg('moduleMigration.logSetupCancelled'), LOG_LEVEL_NOTICE);
|
||||
this._log($msg("moduleMigration.logSetupCancelled"), LOG_LEVEL_NOTICE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,13 +218,10 @@ export class LiveSyncSetting extends Setting {
|
||||
await this.commitValue(value);
|
||||
} else {
|
||||
this.setTooltip(
|
||||
$msg(
|
||||
"liveSyncSetting.valueShouldBeInRange",
|
||||
{
|
||||
$msg("liveSyncSetting.valueShouldBeInRange", {
|
||||
min: opt.clampMin?.toString() || "~",
|
||||
max: opt.clampMax?.toString() || "~",
|
||||
}
|
||||
)
|
||||
})
|
||||
);
|
||||
text.inputEl.toggleClass("sls-item-invalid-value", true);
|
||||
lastError = true;
|
||||
@@ -373,7 +370,9 @@ export class LiveSyncSetting extends Setting {
|
||||
if (this.holdValue && this.selfKey) {
|
||||
const isDirty = LiveSyncSetting.env.isDirty(this.selfKey);
|
||||
const alt = isDirty
|
||||
? $msg("liveSyncSetting.originalValue", { value: String(LiveSyncSetting.env.initialSettings?.[this.selfKey] ?? "") })
|
||||
? $msg("liveSyncSetting.originalValue", {
|
||||
value: String(LiveSyncSetting.env.initialSettings?.[this.selfKey] ?? ""),
|
||||
})
|
||||
: "";
|
||||
this.controlEl.toggleClass("sls-item-dirty", isDirty);
|
||||
if (!this.hasPassword) {
|
||||
|
||||
@@ -384,7 +384,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
const status = await replicator.getRemoteStatus(trialSetting);
|
||||
if (status) {
|
||||
if (status.estimatedSize) {
|
||||
Logger($msg("obsidianLiveSyncSettingTab.logEstimatedSize", { size: sizeToHumanReadable(status.estimatedSize) }), LOG_LEVEL_NOTICE);
|
||||
Logger(
|
||||
$msg("obsidianLiveSyncSettingTab.logEstimatedSize", {
|
||||
size: sizeToHumanReadable(status.estimatedSize),
|
||||
}),
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,7 +469,9 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
// And modified.
|
||||
this.plugin.confirm.askInPopup(
|
||||
`config-reloaded-${k}`,
|
||||
$msg("obsidianLiveSyncSettingTab.msgSettingModified", { setting: getConfName(k as AllSettingItemKey) }),
|
||||
$msg("obsidianLiveSyncSettingTab.msgSettingModified", {
|
||||
setting: getConfName(k as AllSettingItemKey),
|
||||
}),
|
||||
(anchor) => {
|
||||
anchor.text = $msg("obsidianLiveSyncSettingTab.optionHere");
|
||||
anchor.addEventListener("click", () => {
|
||||
@@ -632,9 +639,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (result == OPTION_FETCH) {
|
||||
if (!(await checkWorkingPassphrase())) {
|
||||
if (
|
||||
(await this.plugin.confirm.askYesNoDialog($msg("obsidianLiveSyncSettingTab.msgAreYouSureProceed"), {
|
||||
(await this.plugin.confirm.askYesNoDialog(
|
||||
$msg("obsidianLiveSyncSettingTab.msgAreYouSureProceed"),
|
||||
{
|
||||
defaultOption: "No",
|
||||
})) != "yes"
|
||||
}
|
||||
)) != "yes"
|
||||
)
|
||||
return;
|
||||
}
|
||||
@@ -664,9 +674,14 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
(el) => {
|
||||
el.addClass("wizardHidden");
|
||||
el.createEl("label", { text: $msg("obsidianLiveSyncSettingTab.msgChangesNeedToBeApplied") });
|
||||
void this.addEl(el, "button", { text: $msg("obsidianLiveSyncSettingTab.optionApply"), cls: "mod-warning" }, (buttonEl) => {
|
||||
void this.addEl(
|
||||
el,
|
||||
"button",
|
||||
{ text: $msg("obsidianLiveSyncSettingTab.optionApply"), cls: "mod-warning" },
|
||||
(buttonEl) => {
|
||||
buttonEl.addEventListener("click", () => fireAndForget(async () => await confirmRebuild()));
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
visibleOnly(() => isNeedRebuildLocal() || isNeedRebuildRemote())
|
||||
);
|
||||
@@ -828,10 +843,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
// Logger($msg("obsidianLiveSyncSettingTab.logDatabaseConnected"), LOG_LEVEL_NOTICE);
|
||||
return true;
|
||||
} else {
|
||||
Logger(
|
||||
$msg("obsidianLiveSyncSettingTab.logPassphraseNotCompatible"),
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
Logger($msg("obsidianLiveSyncSettingTab.logPassphraseNotCompatible"), LOG_LEVEL_NOTICE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -875,14 +887,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
};
|
||||
// Panes
|
||||
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelChangeLog"), "💬", 100, false).then((paneEl) => {
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelChangeLog"), "💬", 100, false).then(
|
||||
(paneEl) => {
|
||||
const informationDivEl = this.createEl(paneEl, "div", { text: "" });
|
||||
|
||||
const tmpDiv = createDiv();
|
||||
// tmpDiv.addClass("sls-header-button");
|
||||
tmpDiv.addClass("op-warn-info");
|
||||
|
||||
tmpDiv.innerHTML = `<p>${$msg("obsidianLiveSyncSettingTab.msgNewVersionNote")}</p><button>${$msg("obsidianLiveSyncSettingTab.optionOkReadEverything")}</button>`
|
||||
tmpDiv.innerHTML = `<p>${$msg("obsidianLiveSyncSettingTab.msgNewVersionNote")}</p><button>${$msg("obsidianLiveSyncSettingTab.optionOkReadEverything")}</button>`;
|
||||
if (lastVersion > (this.editingSettings?.lastReadUpdates || 0)) {
|
||||
const informationButtonDiv = informationDivEl.appendChild(tmpDiv);
|
||||
informationButtonDiv.querySelector("button")?.addEventListener("click", () => {
|
||||
@@ -896,7 +909,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
fireAndForget(() =>
|
||||
MarkdownRenderer.render(this.plugin.app, updateInformation, informationDivEl, "/", this.plugin)
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelSetup"), "🧙♂️", 110, false).then((paneEl) => {
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleQuickSetup")).then((paneEl) => {
|
||||
@@ -1077,7 +1091,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
void loadMarkdownPage(topPath);
|
||||
});
|
||||
});
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelGeneralSettings"), "⚙️", 20, false).then((paneEl) => {
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelGeneralSettings"), "⚙️", 20, false).then(
|
||||
(paneEl) => {
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleAppearance")).then((paneEl) => {
|
||||
const languages = Object.fromEntries([
|
||||
["", $msg("obsidianLiveSyncSettingTab.defaultLanguage")],
|
||||
@@ -1110,7 +1125,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
this.changeDisplay("0");
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
let checkResultDiv: HTMLDivElement;
|
||||
const checkConfig = async (checkResultDiv: HTMLDivElement | undefined) => {
|
||||
Logger($msg("obsidianLiveSyncSettingTab.logCheckingDbConfig"), LOG_LEVEL_INFO);
|
||||
@@ -1159,11 +1175,17 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
value
|
||||
);
|
||||
if (res.status == 200) {
|
||||
Logger($msg("obsidianLiveSyncSettingTab.logCouchDbConfigUpdated", { title }), LOG_LEVEL_NOTICE);
|
||||
Logger(
|
||||
$msg("obsidianLiveSyncSettingTab.logCouchDbConfigUpdated", { title }),
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
checkResultDiv.removeChild(x);
|
||||
await checkConfig(checkResultDiv);
|
||||
} else {
|
||||
Logger($msg("obsidianLiveSyncSettingTab.logCouchDbConfigFail", { title }), LOG_LEVEL_NOTICE);
|
||||
Logger(
|
||||
$msg("obsidianLiveSyncSettingTab.logCouchDbConfigFail", { title }),
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
Logger(res.text, LOG_LEVEL_VERBOSE);
|
||||
}
|
||||
});
|
||||
@@ -1254,7 +1276,11 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (responseConfig?.cors?.credentials != "true") {
|
||||
isSuccessful = false;
|
||||
addResult($msg("obsidianLiveSyncSettingTab.errCorsCredentials"));
|
||||
addConfigFixButton($msg("obsidianLiveSyncSettingTab.msgSetCorsCredentials"), "cors/credentials", "true");
|
||||
addConfigFixButton(
|
||||
$msg("obsidianLiveSyncSettingTab.msgSetCorsCredentials"),
|
||||
"cors/credentials",
|
||||
"true"
|
||||
);
|
||||
} else {
|
||||
addResult($msg("obsidianLiveSyncSettingTab.okCorsCredentials"));
|
||||
}
|
||||
@@ -1329,7 +1355,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
return isSuccessful;
|
||||
};
|
||||
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelRemoteConfiguration"), "🛰️", 0, false).then((paneEl) => {
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.panelRemoteConfiguration"), "🛰️", 0, false).then(
|
||||
(paneEl) => {
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleRemoteServer")).then((paneEl) => {
|
||||
// const containerRemoteDatabaseEl = containerEl.createDiv();
|
||||
new Setting(paneEl).autoWireDropDown("remoteType", {
|
||||
@@ -1341,7 +1368,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
onUpdate: enableOnlySyncDisabled,
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleMinioS3R2"), undefined, onlyOnMinIO).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleMinioS3R2"),
|
||||
undefined,
|
||||
onlyOnMinIO
|
||||
).then((paneEl) => {
|
||||
const syncWarnMinio = this.createEl(paneEl, "div", {
|
||||
text: "",
|
||||
});
|
||||
@@ -1369,7 +1401,9 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
new Setting(paneEl).autoWireText("bucket", { holdValue: true });
|
||||
|
||||
new Setting(paneEl).autoWireToggle("useCustomRequestHandler", { holdValue: true });
|
||||
new Setting(paneEl).setName($msg("obsidianLiveSyncSettingTab.nameTestConnection")).addButton((button) =>
|
||||
new Setting(paneEl)
|
||||
.setName($msg("obsidianLiveSyncSettingTab.nameTestConnection"))
|
||||
.addButton((button) =>
|
||||
button
|
||||
.setButtonText($msg("obsidianLiveSyncSettingTab.btnTest"))
|
||||
.setDisabled(false)
|
||||
@@ -1392,7 +1426,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
.addOnUpdate(onlyOnMinIO);
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleCouchDB"), undefined, onlyOnCouchDB).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleCouchDB"),
|
||||
undefined,
|
||||
onlyOnCouchDB
|
||||
).then((paneEl) => {
|
||||
if (this.plugin.$$isMobile()) {
|
||||
this.createEl(
|
||||
paneEl,
|
||||
@@ -1486,7 +1525,9 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
});
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleNotification")).then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
new Setting(paneEl).autoWireNumeric("notifyThresholdOfRemoteStorageSize", {}).setClass("wizardHidden");
|
||||
new Setting(paneEl)
|
||||
.autoWireNumeric("notifyThresholdOfRemoteStorageSize", {})
|
||||
.setClass("wizardHidden");
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.panelPrivacyEncryption")).then((paneEl) => {
|
||||
@@ -1522,7 +1563,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
.setDisabled(false)
|
||||
.onClick(async () => {
|
||||
const trialSetting = { ...this.initialSettings, ...this.editingSettings };
|
||||
const newTweaks = await this.plugin.$$checkAndAskUseRemoteConfiguration(trialSetting);
|
||||
const newTweaks =
|
||||
await this.plugin.$$checkAndAskUseRemoteConfiguration(trialSetting);
|
||||
if (newTweaks.result !== false) {
|
||||
this.editingSettings = { ...this.editingSettings, ...newTweaks.result };
|
||||
this.requestUpdate();
|
||||
@@ -1540,7 +1582,10 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (
|
||||
(await this.plugin.confirm.askYesNoDialog(
|
||||
$msg("obsidianLiveSyncSettingTab.msgConfigCheckFailed"),
|
||||
{ defaultOption: "No", title: $msg("obsidianLiveSyncSettingTab.titleRemoteConfigCheckFailed") }
|
||||
{
|
||||
defaultOption: "No",
|
||||
title: $msg("obsidianLiveSyncSettingTab.titleRemoteConfigCheckFailed"),
|
||||
}
|
||||
)) == "no"
|
||||
) {
|
||||
return;
|
||||
@@ -1552,7 +1597,10 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (
|
||||
(await this.plugin.confirm.askYesNoDialog(
|
||||
$msg("obsidianLiveSyncSettingTab.msgEnableEncryptionRecommendation"),
|
||||
{ defaultOption: "No", title: $msg("obsidianLiveSyncSettingTab.titleEncryptionNotEnabled") }
|
||||
{
|
||||
defaultOption: "No",
|
||||
title: $msg("obsidianLiveSyncSettingTab.titleEncryptionNotEnabled"),
|
||||
}
|
||||
)) == "no"
|
||||
) {
|
||||
return;
|
||||
@@ -1565,7 +1613,10 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (
|
||||
(await this.plugin.confirm.askYesNoDialog(
|
||||
$msg("obsidianLiveSyncSettingTab.msgInvalidPassphrase"),
|
||||
{ defaultOption: "No", title: $msg("obsidianLiveSyncSettingTab.titleEncryptionPassphraseInvalid") }
|
||||
{
|
||||
defaultOption: "No",
|
||||
title: $msg("obsidianLiveSyncSettingTab.titleEncryptionPassphraseInvalid"),
|
||||
}
|
||||
)) == "no"
|
||||
) {
|
||||
return;
|
||||
@@ -1596,8 +1647,10 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
changeDisplay("30");
|
||||
})
|
||||
);
|
||||
});
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.titleSyncSettings"), "🔄", 30, false).then((paneEl) => {
|
||||
}
|
||||
);
|
||||
void addPane(containerEl, $msg("obsidianLiveSyncSettingTab.titleSyncSettings"), "🔄", 30, false).then(
|
||||
(paneEl) => {
|
||||
if (this.editingSettings.versionUpFlash != "") {
|
||||
const c = this.createEl(
|
||||
paneEl,
|
||||
@@ -1607,7 +1660,11 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
cls: "op-warn sls-setting-hidden",
|
||||
},
|
||||
(el) => {
|
||||
this.createEl(el, "button", { text: $msg("obsidianLiveSyncSettingTab.btnGotItAndUpdated") }, (e) => {
|
||||
this.createEl(
|
||||
el,
|
||||
"button",
|
||||
{ text: $msg("obsidianLiveSyncSettingTab.btnGotItAndUpdated") },
|
||||
(e) => {
|
||||
e.addClass("mod-cta");
|
||||
e.addEventListener("click", () => {
|
||||
fireAndForget(async () => {
|
||||
@@ -1616,7 +1673,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
c.remove();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
visibleOnly(() => !this.isConfiguredAs("versionUpFlash", ""))
|
||||
);
|
||||
@@ -1717,7 +1775,10 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
if (
|
||||
(await this.plugin.confirm.askYesNoDialog(
|
||||
$msg("obsidianLiveSyncSettingTab.msgGenerateSetupURI"),
|
||||
{ defaultOption: "Yes", title: $msg("obsidianLiveSyncSettingTab.titleCongratulations") }
|
||||
{
|
||||
defaultOption: "Yes",
|
||||
title: $msg("obsidianLiveSyncSettingTab.titleCongratulations"),
|
||||
}
|
||||
)) == "yes"
|
||||
) {
|
||||
eventHub.emitEvent(EVENT_REQUEST_COPY_SETUP_URI);
|
||||
@@ -1812,13 +1873,25 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
});
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleDeletionPropagation"), undefined, undefined, LEVEL_ADVANCED).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleDeletionPropagation"),
|
||||
undefined,
|
||||
undefined,
|
||||
LEVEL_ADVANCED
|
||||
).then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("trashInsteadDelete");
|
||||
|
||||
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("doNotDeleteFolder");
|
||||
});
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleConflictResolution"), undefined, undefined, LEVEL_ADVANCED).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleConflictResolution"),
|
||||
undefined,
|
||||
undefined,
|
||||
LEVEL_ADVANCED
|
||||
).then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
|
||||
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("resolveConflictsByNewerFile");
|
||||
@@ -1828,7 +1901,13 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("showMergeDialogOnlyOnActive");
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleSyncSettingsViaMarkdown"), undefined, undefined, LEVEL_ADVANCED).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleSyncSettingsViaMarkdown"),
|
||||
undefined,
|
||||
undefined,
|
||||
LEVEL_ADVANCED
|
||||
).then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
|
||||
new Setting(paneEl)
|
||||
@@ -1840,7 +1919,13 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
new Setting(paneEl).autoWireToggle("notifyAllSettingSyncFile");
|
||||
});
|
||||
|
||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleHiddenFiles"), undefined, undefined, LEVEL_ADVANCED).then((paneEl) => {
|
||||
void addPanel(
|
||||
paneEl,
|
||||
$msg("obsidianLiveSyncSettingTab.titleHiddenFiles"),
|
||||
undefined,
|
||||
undefined,
|
||||
LEVEL_ADVANCED
|
||||
).then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
|
||||
const LABEL_ENABLED = $msg("obsidianLiveSyncSettingTab.labelEnabled");
|
||||
@@ -1859,7 +1944,9 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
.setName($msg("obsidianLiveSyncSettingTab.nameDisableHiddenFileSync"))
|
||||
.setClass("wizardHidden")
|
||||
.addButton((button) => {
|
||||
button.setButtonText($msg("obsidianLiveSyncSettingTab.btnDisable")).onClick(async () => {
|
||||
button
|
||||
.setButtonText($msg("obsidianLiveSyncSettingTab.btnDisable"))
|
||||
.onClick(async () => {
|
||||
this.editingSettings.syncInternalFiles = false;
|
||||
await this.saveAllDirtySettings();
|
||||
this.display();
|
||||
@@ -1902,7 +1989,8 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
acceptZero: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
void addPane(containerEl, "Selector", "🚦", 33, false, LEVEL_ADVANCED).then((paneEl) => {
|
||||
void addPanel(paneEl, "Normal Files").then((paneEl) => {
|
||||
paneEl.addClass("wizardHidden");
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ModuleLiveSyncMain extends AbstractModule implements ICoreModule {
|
||||
const ANSWER_RESUME = $msg("moduleLiveSyncMain.optionResumeAndRestart");
|
||||
const message = $msg("moduleLiveSyncMain.msgScramEnabled", {
|
||||
fileWatchingStatus: this.settings.suspendFileWatching ? "suspended" : "active",
|
||||
parseReplicationStatus: this.settings.suspendParseReplicationResult ? "suspended" : "active"
|
||||
parseReplicationStatus: this.settings.suspendParseReplicationResult ? "suspended" : "active",
|
||||
});
|
||||
if (
|
||||
(await this.core.confirm.askSelectStringDialogue(message, [ANSWER_KEEP, ANSWER_RESUME], {
|
||||
|
||||
Reference in New Issue
Block a user