mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-02-01 19:14:29 +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:
parent
4835fce62a
commit
3773e57429
@ -304,15 +304,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
.onClick(async () => {
|
||||
const checkConfig = async () => {
|
||||
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();
|
||||
emptyDiv.innerHTML = "<span></span>";
|
||||
@ -326,6 +317,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
tmpDiv.innerHTML = `${msg}`;
|
||||
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 tmpDiv = createDiv();
|
||||
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"]);
|
||||
Logger(`Checking configuration done`, LOG_LEVEL_INFO);
|
||||
} 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(ex);
|
||||
}
|
||||
}
|
||||
};
|
||||
await checkConfig();
|
||||
})
|
||||
@ -1201,7 +1207,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
||||
.setValue(this.plugin.settings.syncInternalFilesInterval + "")
|
||||
.onChange(async (value) => {
|
||||
let v = Number(value);
|
||||
if (isNaN(v) || v < 10) {
|
||||
if (v !== 0 && (isNaN(v) || v < 10)) {
|
||||
v = 10;
|
||||
}
|
||||
this.plugin.settings.syncInternalFilesInterval = v;
|
||||
|
@ -576,7 +576,13 @@ export default class ObsidianLiveSyncPlugin extends Plugin
|
||||
this.addRibbonIcon("view-log", "Show 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.app.workspace.onLayoutReady(this.onLayoutReady.bind(this));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user