mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Add button in Obsidian plugin settings to force re-indexing your vault
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { App, PluginSettingTab, Setting } from 'obsidian';
|
||||
import { App, PluginSettingTab, request, Setting } from 'obsidian';
|
||||
import Khoj from 'src/main';
|
||||
import { getVaultAbsolutePath } from 'src/utils';
|
||||
|
||||
@@ -35,7 +35,7 @@ export class KhojSettingTab extends PluginSettingTab {
|
||||
|
||||
// Add khoj settings configurable from the plugin settings tab
|
||||
new Setting(containerEl)
|
||||
.setName('Vault Paths')
|
||||
.setName('Vault Path')
|
||||
.setDesc('The Obsidian Vault to search with Khoj')
|
||||
.addText(text => text
|
||||
.setValue(`${this.plugin.settings.obsidianVaultPath}`)
|
||||
@@ -53,7 +53,7 @@ export class KhojSettingTab extends PluginSettingTab {
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
new Setting(containerEl)
|
||||
.setName('Number of Results')
|
||||
.setName('Results Count')
|
||||
.setDesc('The number of search results to show')
|
||||
.addText(text => text
|
||||
.setPlaceholder('6')
|
||||
@@ -62,5 +62,14 @@ export class KhojSettingTab extends PluginSettingTab {
|
||||
this.plugin.settings.resultsCount = parseInt(value);
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
new Setting(containerEl)
|
||||
.setName('Index Vault')
|
||||
.setDesc('Manually force Khoj to re-index your Obsidian Vault')
|
||||
.addButton(button => button
|
||||
.setButtonText('Update')
|
||||
.onClick(async () => {
|
||||
await request(`${this.plugin.settings.khojUrl}/api/update?t=markdown&force=true`);
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user