add_tags option added. see #183
This commit is contained in:
parent
1776abcb15
commit
7ec4ef89a0
4 changed files with 28 additions and 0 deletions
|
|
@ -742,5 +742,13 @@
|
|||
"prompt_this_full_text": {
|
||||
"message": "Reply with only the needed text and with no extra comments or other text.",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags": {
|
||||
"message": "Add tags to emails",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags_Info": {
|
||||
"message": "If checked, a menu item will be added to the dynamic menu to add tags to emails.",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
|
|
@ -37,4 +37,5 @@ export const prefs_default = {
|
|||
dynamic_menu_order_alphabet: true,
|
||||
placeholders_use_default_value: false,
|
||||
max_prompt_length: 30000, // max string length for prompt
|
||||
add_tags: false,
|
||||
}
|
||||
|
|
@ -266,6 +266,15 @@
|
|||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="add_tags_tr">
|
||||
<td><span>__MSG_prefs_OptionText_add_tags__</span></td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" id="add_tags" name="add_tags" class="option-input" />
|
||||
__MSG_prefs_OptionText_add_tags_Info__
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:20em"><label>
|
||||
<span>__MSG_Debug__</span>
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ async function restoreOptions() {
|
|||
|
||||
function showConnectionOptions() {
|
||||
disable_MaxPromptLength();
|
||||
disable_AddTags();
|
||||
let chatgpt_web_display = 'table-row';
|
||||
let chatgpt_api_display = 'none';
|
||||
let ollama_api_display = 'none';
|
||||
|
|
@ -212,6 +213,14 @@ function disable_MaxPromptLength(){
|
|||
maxPromptLength_tr.style.display = (maxPromptLength.disabled) ? 'none' : 'table-row';
|
||||
}
|
||||
|
||||
function disable_AddTags(){
|
||||
let add_tags = document.getElementById('add_tags');
|
||||
let conntype_select = document.getElementById("connection_type");
|
||||
add_tags.disabled = (conntype_select.value === "chatgpt_web");
|
||||
let add_tags_tr = document.getElementById('add_tags_tr');
|
||||
add_tags_tr.style.display = (add_tags.disabled) ? 'none' : 'table-row';
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
await restoreOptions();
|
||||
|
||||
|
|
@ -401,6 +410,7 @@ select_openai_comp_model.addEventListener("change", warn_OpenAIComp_HostEmpty);
|
|||
warn_Ollama_HostEmpty();
|
||||
warn_OpenAIComp_HostEmpty();
|
||||
disable_MaxPromptLength();
|
||||
disable_AddTags();
|
||||
|
||||
const passwordField_chatgpt_api_key = document.getElementById('chatgpt_api_key');
|
||||
const toggleIcon_chatgpt_api_key = document.getElementById('toggle_chatgpt_api_key');
|
||||
|
|
|
|||
Loading…
Reference in a new issue