mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 21:29:12 +00:00
Add placeholder text to modal in Khoj Obsidian plugin
This commit is contained in:
@@ -48,12 +48,15 @@ export class KhojModal extends SuggestModal<SearchResult> {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
this.setInstructions(modalInstructions);
|
this.setInstructions(modalInstructions);
|
||||||
|
|
||||||
|
// Set Placeholder Text for Modal
|
||||||
|
this.setPlaceholder('Search with Khoj...');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSuggestions(query: string): Promise<SearchResult[]> {
|
async getSuggestions(query: string): Promise<SearchResult[]> {
|
||||||
// Query Khoj backend for search results
|
// Query Khoj backend for search results
|
||||||
var searchUrl = `${this.setting.khojUrl}/api/search?q=${query}&n=${this.setting.resultsCount}&r=${this.rerank}&t=markdown`
|
let searchUrl = `${this.setting.khojUrl}/api/search?q=${query}&n=${this.setting.resultsCount}&r=${this.rerank}&t=markdown`
|
||||||
var results = await request(searchUrl)
|
let results = await request(searchUrl)
|
||||||
.then(response => JSON.parse(response))
|
.then(response => JSON.parse(response))
|
||||||
.then(data => {
|
.then(data => {
|
||||||
return data.map((result: any) => {
|
return data.map((result: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user