add_tags_maxnum option added. see #183
This commit is contained in:
parent
45b26747fa
commit
99cab276fa
4 changed files with 29 additions and 3 deletions
|
|
@ -766,5 +766,13 @@
|
||||||
"placeholder_full_tags_list": {
|
"placeholder_full_tags_list": {
|
||||||
"message": "Existing tags",
|
"message": "Existing tags",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
},
|
||||||
|
"prefs_OptionText_add_tags_maxnum": {
|
||||||
|
"message": "Maximum number of tags",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"prefs_OptionText_add_tags_maxnum_Info": {
|
||||||
|
"message": "The maximum number of tags proposed by the AI.",
|
||||||
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -38,4 +38,5 @@ export const prefs_default = {
|
||||||
placeholders_use_default_value: false,
|
placeholders_use_default_value: false,
|
||||||
max_prompt_length: 30000, // max string length for prompt
|
max_prompt_length: 30000, // max string length for prompt
|
||||||
add_tags: false,
|
add_tags: false,
|
||||||
|
add_tags_maxnum: 3,
|
||||||
}
|
}
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="add_tags_tr">
|
<tr class="add_tags_tr">
|
||||||
<td><span>__MSG_prefs_OptionText_add_tags__</span></td>
|
<td><span>__MSG_prefs_OptionText_add_tags__</span></td>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
|
|
@ -275,6 +275,15 @@
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="add_tags_tr">
|
||||||
|
<td><span>__MSG_prefs_OptionText_add_tags_maxnum__</span></td>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input type="number" id="add_tags_maxnum" name="add_tags_maxnum" class="option-input" />
|
||||||
|
<br>__MSG_prefs_OptionText_add_tags_maxnum_Info__
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:20em"><label>
|
<td style="width:20em"><label>
|
||||||
<span>__MSG_Debug__</span>
|
<span>__MSG_Debug__</span>
|
||||||
|
|
|
||||||
|
|
@ -215,10 +215,18 @@ function disable_MaxPromptLength(){
|
||||||
|
|
||||||
function disable_AddTags(){
|
function disable_AddTags(){
|
||||||
let add_tags = document.getElementById('add_tags');
|
let add_tags = document.getElementById('add_tags');
|
||||||
|
let add_tags_maxnum = document.getElementById('add_tags_maxnum');
|
||||||
let conntype_select = document.getElementById("connection_type");
|
let conntype_select = document.getElementById("connection_type");
|
||||||
add_tags.disabled = (conntype_select.value === "chatgpt_web");
|
add_tags.disabled = (conntype_select.value === "chatgpt_web");
|
||||||
let add_tags_tr = document.getElementById('add_tags_tr');
|
add_tags_maxnum.disabled = (conntype_select.value === "chatgpt_web");
|
||||||
|
|
||||||
|
// Seleziona tutti gli elementi con la classe 'add_tags_tr'
|
||||||
|
let add_tags_tr_elements = document.querySelectorAll('.add_tags_tr');
|
||||||
|
|
||||||
|
// Applica lo stile a tutti gli elementi con la classe
|
||||||
|
add_tags_tr_elements.forEach(add_tags_tr => {
|
||||||
add_tags_tr.style.display = (add_tags.disabled) ? 'none' : 'table-row';
|
add_tags_tr.style.display = (add_tags.disabled) ? 'none' : 'table-row';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue