mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Allow set up of search form via query params in web interface
- Default search type to org, instead of images
This commit is contained in:
parent
02ca2c05a1
commit
3079614981
1 changed files with 8 additions and 3 deletions
|
@ -86,6 +86,11 @@
|
|||
else if (type !== "image") {
|
||||
search(rerank=false);
|
||||
}
|
||||
|
||||
// Fill search form with values passed in URL query parameters, if any.
|
||||
window.onload = function () {
|
||||
document.getElementById("type").value = new URLSearchParams(window.location.search).get("t") || "org";
|
||||
document.getElementById("query").value = new URLSearchParams(window.location.search).get("q") || "What is the meaning of life?";
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -97,13 +102,13 @@
|
|||
|
||||
<!--Add Dropdown to Select Query Type.
|
||||
Query Types can be: org, ledger, image, music, markdown.
|
||||
Set Default type to image-->
|
||||
Set Default type to org-->
|
||||
<select id="type">
|
||||
<option value="image">Image</option>
|
||||
<option value="org">Org</option>
|
||||
<option value="markdown">Markdown</option>
|
||||
<option value="ledger">Ledger</option>
|
||||
<option value="music">Music</option>
|
||||
<option value="image">Image</option>
|
||||
<option value="markdown">Markdown</option>
|
||||
</select>
|
||||
|
||||
<!--Add Button To Regenerate -->
|
||||
|
|
Loading…
Add table
Reference in a new issue