You've already forked obsidian-livesync
mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-07-16 00:14:19 +02:00
Improved:
- We can open the log pane also from the command palette now. - Now, the hidden file scanning interval could be configured to 0. - `Check database configuration` now points out that we do not have administrator permission.
This commit is contained in:
@ -304,15 +304,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
const checkConfig = async () => {
|
const checkConfig = async () => {
|
||||||
Logger(`Checking database configuration`, LOG_LEVEL_INFO);
|
Logger(`Checking database configuration`, LOG_LEVEL_INFO);
|
||||||
try {
|
|
||||||
if (isCloudantURI(this.plugin.settings.couchDB_URI)) {
|
|
||||||
Logger("This feature cannot be used with IBM Cloudant.", LOG_LEVEL_NOTICE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const r = await requestToCouchDB(this.plugin.settings.couchDB_URI, this.plugin.settings.couchDB_USER, this.plugin.settings.couchDB_PASSWORD, window.origin);
|
|
||||||
|
|
||||||
const responseConfig = r.json;
|
|
||||||
|
|
||||||
const emptyDiv = createDiv();
|
const emptyDiv = createDiv();
|
||||||
emptyDiv.innerHTML = "<span></span>";
|
emptyDiv.innerHTML = "<span></span>";
|
||||||
@ -326,6 +317,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
tmpDiv.innerHTML = `${msg}`;
|
tmpDiv.innerHTML = `${msg}`;
|
||||||
checkResultDiv.appendChild(tmpDiv);
|
checkResultDiv.appendChild(tmpDiv);
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (isCloudantURI(this.plugin.settings.couchDB_URI)) {
|
||||||
|
Logger("This feature cannot be used with IBM Cloudant.", LOG_LEVEL_NOTICE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const r = await requestToCouchDB(this.plugin.settings.couchDB_URI, this.plugin.settings.couchDB_USER, this.plugin.settings.couchDB_PASSWORD, window.origin);
|
||||||
|
const responseConfig = r.json;
|
||||||
|
|
||||||
const addConfigFixButton = (title: string, key: string, value: string) => {
|
const addConfigFixButton = (title: string, key: string, value: string) => {
|
||||||
const tmpDiv = createDiv();
|
const tmpDiv = createDiv();
|
||||||
tmpDiv.addClass("ob-btn-config-fix");
|
tmpDiv.addClass("ob-btn-config-fix");
|
||||||
@ -452,9 +452,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
addResult("If you have some trouble with Connection-check even though all Config-check has been passed, Please check your reverse proxy's configuration.", ["ob-btn-config-info"]);
|
addResult("If you have some trouble with Connection-check even though all Config-check has been passed, Please check your reverse proxy's configuration.", ["ob-btn-config-info"]);
|
||||||
Logger(`Checking configuration done`, LOG_LEVEL_INFO);
|
Logger(`Checking configuration done`, LOG_LEVEL_INFO);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
if (ex?.status == 401) {
|
||||||
|
addResult(`❗ Access forbidden.`);
|
||||||
|
addResult(`We could not continue the test.`);
|
||||||
|
Logger(`Checking configuration done`, LOG_LEVEL_INFO);
|
||||||
|
} else {
|
||||||
Logger(`Checking configuration failed`, LOG_LEVEL_NOTICE);
|
Logger(`Checking configuration failed`, LOG_LEVEL_NOTICE);
|
||||||
Logger(ex);
|
Logger(ex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
await checkConfig();
|
await checkConfig();
|
||||||
})
|
})
|
||||||
@ -1201,7 +1207,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setValue(this.plugin.settings.syncInternalFilesInterval + "")
|
.setValue(this.plugin.settings.syncInternalFilesInterval + "")
|
||||||
.onChange(async (value) => {
|
.onChange(async (value) => {
|
||||||
let v = Number(value);
|
let v = Number(value);
|
||||||
if (isNaN(v) || v < 10) {
|
if (v !== 0 && (isNaN(v) || v < 10)) {
|
||||||
v = 10;
|
v = 10;
|
||||||
}
|
}
|
||||||
this.plugin.settings.syncInternalFilesInterval = v;
|
this.plugin.settings.syncInternalFilesInterval = v;
|
||||||
|
@ -576,7 +576,13 @@ export default class ObsidianLiveSyncPlugin extends Plugin
|
|||||||
this.addRibbonIcon("view-log", "Show log", () => {
|
this.addRibbonIcon("view-log", "Show log", () => {
|
||||||
this.showView(VIEW_TYPE_LOG);
|
this.showView(VIEW_TYPE_LOG);
|
||||||
});
|
});
|
||||||
|
this.addCommand({
|
||||||
|
id: "view-log",
|
||||||
|
name: "Show log",
|
||||||
|
callback: () => {
|
||||||
|
this.showView(VIEW_TYPE_LOG);
|
||||||
|
}
|
||||||
|
});
|
||||||
this.addSettingTab(new ObsidianLiveSyncSettingTab(this.app, this));
|
this.addSettingTab(new ObsidianLiveSyncSettingTab(this.app, this));
|
||||||
this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this));
|
this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user