Purge no-op history events
This commit is contained in:
parent
3b88f98fd9
commit
ab5336f567
4 changed files with 2 additions and 36 deletions
|
|
@ -94,15 +94,7 @@ export class HistoryView extends ItemView {
|
||||||
container.empty();
|
container.empty();
|
||||||
container.createEl("h4", { text: "VaultLink History" });
|
container.createEl("h4", { text: "VaultLink History" });
|
||||||
|
|
||||||
const entries = this.client.history
|
const entries = this.client.history.getEntries().reverse();
|
||||||
.getEntries()
|
|
||||||
.reverse()
|
|
||||||
.filter(
|
|
||||||
(entry) =>
|
|
||||||
entry.status !== SyncStatus.NO_OP ||
|
|
||||||
this.client.settings.getSettings().displayNoopSyncEvents
|
|
||||||
);
|
|
||||||
|
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
container.createDiv(
|
container.createDiv(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -291,25 +291,6 @@ export class SyncSettingsTab extends PluginSettingTab {
|
||||||
private renderViewSettings(containerEl: HTMLElement): void {
|
private renderViewSettings(containerEl: HTMLElement): void {
|
||||||
containerEl.createEl("h3", { text: "View" });
|
containerEl.createEl("h3", { text: "View" });
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName("Show no-op sync operations in history")
|
|
||||||
.setDesc(
|
|
||||||
"Enabling this will make the history view more verbose while also providing more explanation for the scyning choices made."
|
|
||||||
)
|
|
||||||
.addToggle((toggle) =>
|
|
||||||
toggle
|
|
||||||
.setValue(
|
|
||||||
this.syncClient.settings.getSettings()
|
|
||||||
.displayNoopSyncEvents
|
|
||||||
)
|
|
||||||
.onChange(async (value) =>
|
|
||||||
this.syncClient.settings.setSetting(
|
|
||||||
"displayNoopSyncEvents",
|
|
||||||
value
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName("Minimum log level")
|
.setName("Minimum log level")
|
||||||
.setDesc(
|
.setDesc(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ export interface SyncSettings {
|
||||||
fetchChangesUpdateIntervalMs: number;
|
fetchChangesUpdateIntervalMs: number;
|
||||||
syncConcurrency: number;
|
syncConcurrency: number;
|
||||||
isSyncEnabled: boolean;
|
isSyncEnabled: boolean;
|
||||||
displayNoopSyncEvents: boolean;
|
|
||||||
minimumLogLevel: LogLevel;
|
minimumLogLevel: LogLevel;
|
||||||
maxFileSizeMB: number;
|
maxFileSizeMB: number;
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +19,6 @@ const DEFAULT_SETTINGS: SyncSettings = {
|
||||||
fetchChangesUpdateIntervalMs: 1000,
|
fetchChangesUpdateIntervalMs: 1000,
|
||||||
syncConcurrency: 1,
|
syncConcurrency: 1,
|
||||||
isSyncEnabled: false,
|
isSyncEnabled: false,
|
||||||
displayNoopSyncEvents: false,
|
|
||||||
minimumLogLevel: LogLevel.INFO,
|
minimumLogLevel: LogLevel.INFO,
|
||||||
maxFileSizeMB: 10
|
maxFileSizeMB: 10
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ export enum SyncSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum SyncStatus {
|
export enum SyncStatus {
|
||||||
NO_OP = "NO_OP",
|
|
||||||
SUCCESS = "SUCCESS",
|
SUCCESS = "SUCCESS",
|
||||||
ERROR = "ERROR"
|
ERROR = "ERROR"
|
||||||
}
|
}
|
||||||
|
|
@ -83,15 +82,11 @@ export class SyncHistory {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`History entry: ${entry.relativePath} - ${entry.message}`
|
`History entry: ${entry.relativePath} - ${entry.message}`
|
||||||
);
|
);
|
||||||
} else if (entry.status === SyncStatus.ERROR) {
|
} else {
|
||||||
this.status.error++;
|
this.status.error++;
|
||||||
this.logger.error(
|
this.logger.error(
|
||||||
`Error syncing file: ${entry.relativePath} - ${entry.message}`
|
`Error syncing file: ${entry.relativePath} - ${entry.message}`
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
this.logger.debug(
|
|
||||||
`No-op syncing file: ${entry.relativePath} - ${entry.message}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.syncHistoryUpdateListeners.forEach((listener) => {
|
this.syncHistoryUpdateListeners.forEach((listener) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue