diff --git a/templates/index.html b/templates/index.html
index f28556d..29aa315 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -351,7 +351,7 @@
} catch (e) {}
}
- async function updateModelDropdown(isInitialLoad = false) {
+ async function updateModelDropdown(isInitialLoad = false) {
const provider = document.getElementById('ai-provider').value;
const modelSelect = document.getElementById('ai-model');
const urlContainer = document.getElementById('ollama-url-container');
@@ -361,7 +361,13 @@
modelSelect.innerHTML = '';
try {
- const res = await fetch(`/api/models?provider=${provider}&url=${encodeURIComponent(ollamaUrl)}`);
+ // URL Parameter nur aufbauen, wenn nötig
+ let queryUrl = `/api/models?provider=${provider}`;
+ if (provider === "ollama") {
+ queryUrl += `&url=${encodeURIComponent(ollamaUrl)}`;
+ }
+
+ const res = await fetch(queryUrl);
const data = await res.json();
modelSelect.innerHTML = '';
@@ -372,10 +378,14 @@
modelSelect.appendChild(opt);
});
- const savedModel = currentSettings[`${provider}_model`];
+ // Korrektur: In deiner main.py ist ein Tippfehler bei "mvidia_model" (mit m)
+ // Prüfe das in deiner settings API oder korrigiere es hier:
+ const savedModel = currentSettings[`${provider}_model`] || currentSettings[`mvidia_model` if provider === 'nvidia'];
if (isInitialLoad && savedModel) modelSelect.value = savedModel;
}
- } catch (e) { modelSelect.innerHTML = ''; }
+ } catch (e) {
+ modelSelect.innerHTML = '';
+ }
}
async function saveSettings() {