mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Add button in Obsidian plugin settings to force re-indexing your vault
This commit is contained in:
parent
f046a95f3d
commit
7991ab7a86
1 changed files with 12 additions and 3 deletions
|
@ -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`);
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue