mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Use more descriptive field names for content type settings on Khoj web
Resolves #281
This commit is contained in:
parent
a2c668268f
commit
f5cf09424b
1 changed files with 12 additions and 4 deletions
|
@ -10,7 +10,7 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="input-files">Input Files</label>
|
||||
<label for="input-files">Files</label>
|
||||
</td>
|
||||
<td id="input-files-cell">
|
||||
{% if current_config['input_files'] is none %}
|
||||
|
@ -27,14 +27,14 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="input-filter">Input Filter</label>
|
||||
<label for="input-filter">Folders</label>
|
||||
</td>
|
||||
<td id="input-filter-cell">
|
||||
{% if current_config['input_filter'] is none %}
|
||||
<input type="text" id="input-filter" name="input-filter">
|
||||
{% else %}
|
||||
{% for input_filter in current_config['input_filter'] %}
|
||||
<input type="text" id="input-filter" name="input-filter" value="{{ input_filter }}">
|
||||
<input type="text" id="input-filter" name="input-filter" value="{{ input_filter.split('/*')[0] }}">
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</td>
|
||||
|
@ -106,11 +106,19 @@
|
|||
|
||||
submit.addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
let suffix = ""
|
||||
if ('{{content_type}}' == "markdown")
|
||||
suffix = "**/*.md"
|
||||
else if ('{{content_type}}' == "org")
|
||||
suffix = "**/*.org"
|
||||
else if ('{{content_type}}' === "pdf")
|
||||
suffix = "**/*.pdf"
|
||||
|
||||
var inputFileNodes = document.getElementsByName("input-files");
|
||||
var input_files = getValidInputNodes(inputFileNodes).map(node => node.value);
|
||||
|
||||
var inputFilterNodes = document.getElementsByName("input-filter");
|
||||
var input_filter = getValidInputNodes(inputFilterNodes).map(node => node.value);
|
||||
var input_filter = getValidInputNodes(inputFilterNodes).map(node => `${node.value}/${suffix}`);
|
||||
|
||||
if (input_files.length === 0 && input_filter.length === 0) {
|
||||
alert("You must specify at least one input file or input filter.");
|
||||
|
|
Loading…
Add table
Reference in a new issue