showing an error in fetching models, if needed. fixes #116
This commit is contained in:
parent
a514e41137
commit
8483ea627b
1 changed files with 35 additions and 29 deletions
|
|
@ -220,6 +220,7 @@ select_ollama_model.appendChild(ollama_option);
|
|||
document.getElementById('btnUpdateOllamaModels').addEventListener('click', async () => {
|
||||
document.getElementById('ollama_model_fetch_loading').style.display = 'inline';
|
||||
let ollama = new Ollama(document.getElementById("ollama_host").value, true);
|
||||
try {
|
||||
let data = await ollama.fetchModels();
|
||||
if(!data){
|
||||
document.getElementById('ollama_model_fetch_loading').style.display = 'none';
|
||||
|
|
@ -250,6 +251,11 @@ select_ollama_model.appendChild(ollama_option);
|
|||
}
|
||||
});
|
||||
document.getElementById('ollama_model_fetch_loading').style.display = 'none';
|
||||
} catch (error) {
|
||||
document.getElementById('ollama_model_fetch_loading').style.display = 'none';
|
||||
taLog.error(browser.i18n.getMessage("Ollama_Models_Error_fetching"));
|
||||
alert(browser.i18n.getMessage("Ollama_Models_Error_fetching")+": " + error.message);
|
||||
}
|
||||
|
||||
warnAPIKeyEmpty();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue