mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Add placeholder text to modal in Khoj Obsidian plugin
This commit is contained in:
parent
580f4aca23
commit
da49ea272c
1 changed files with 5 additions and 2 deletions
|
@ -48,12 +48,15 @@ export class KhojModal extends SuggestModal<SearchResult> {
|
|||
},
|
||||
]
|
||||
this.setInstructions(modalInstructions);
|
||||
|
||||
// Set Placeholder Text for Modal
|
||||
this.setPlaceholder('Search with Khoj...');
|
||||
}
|
||||
|
||||
async getSuggestions(query: string): Promise<SearchResult[]> {
|
||||
// Query Khoj backend for search results
|
||||
var searchUrl = `${this.setting.khojUrl}/api/search?q=${query}&n=${this.setting.resultsCount}&r=${this.rerank}&t=markdown`
|
||||
var results = await request(searchUrl)
|
||||
let searchUrl = `${this.setting.khojUrl}/api/search?q=${query}&n=${this.setting.resultsCount}&r=${this.rerank}&t=markdown`
|
||||
let results = await request(searchUrl)
|
||||
.then(response => JSON.parse(response))
|
||||
.then(data => {
|
||||
return data.map((result: any) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue