templates/index.html aktualisiert

This commit is contained in:
2026-03-06 13:04:05 +00:00
parent 45c354c6a8
commit 9199903fbb

View File

@@ -324,9 +324,19 @@
modelSelect.innerHTML = '<option>Lade Modelle...</option>';
// API-Query vorbereiten
// API-Query vorbereiten
let apiUrl = `/api/models?provider=${provider}`;
if (provider === "ollama" && ollamaUrl) {
// FIX: Prüfen, ob die URL mit /v1 endet. Wenn nicht, hängen wir es an.
if (!ollamaUrl.endsWith('/v1') && !ollamaUrl.includes('/api')) {
// Eventuellen Schrägstrich am Ende entfernen und /v1 anhängen
ollamaUrl = ollamaUrl.replace(/\/$/, '') + '/v1';
// Das Input-Feld direkt aktualisieren, damit es beim Speichern stimmt
document.getElementById('ollama-url').value = ollamaUrl;
}
apiUrl += `&base_url=${encodeURIComponent(ollamaUrl)}`;
}