in the openai comp integration is now possibile to clear the models list. see #472
This commit is contained in:
parent
eb3416db59
commit
d68e7d6d68
3 changed files with 23 additions and 2 deletions
|
|
@ -1620,5 +1620,13 @@
|
|||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Please note that any <br> tags in the AI's response will be replaced with line breaks.",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Clear Models List",
|
||||
"description": ""
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Are you sure you want to clear the Models List? This action cannot be undone.",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
|
|
@ -410,7 +410,8 @@
|
|||
<td>
|
||||
<label>
|
||||
<span class="opt_title">__MSG_OpenAIComp_Models__</span>
|
||||
<br><button id="btnOpenAICompForceModel" class="btn_small">__MSG_prefs_OpenAIComp_ForceModel__</button></td>
|
||||
<br><button id="btnOpenAICompForceModel" class="btn_small">__MSG_prefs_OpenAIComp_ForceModel__</button>
|
||||
<br><button id="btnOpenAICompClearModelsList" class="btn_small">__MSG_prefs_OpenAIComp_ClearModelsList__</button></td>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -511,10 +511,22 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
option.text = modelName;
|
||||
select_openai_comp_model.appendChild(option);
|
||||
select_openai_comp_model.value = modelName;
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('btnOpenAICompClearModelsList').addEventListener('click', () => {
|
||||
if (!confirm(browser.i18n.getMessage('OpenAIComp_ClearModelsList_Confirm'))) {
|
||||
return;
|
||||
}
|
||||
let select_openai_comp_model = document.getElementById('openai_comp_model');
|
||||
while (select_openai_comp_model.options.length > 0) {
|
||||
select_openai_comp_model.remove(0);
|
||||
}
|
||||
select_openai_comp_model.value = '';
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
});
|
||||
|
||||
document.getElementById('btnGiveAllUrlsPermission_ollama_api').addEventListener('click', async () => {
|
||||
permission_all_urls = await messenger.permissions.request({ origins: ["<all_urls>"] });
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue