Ollama-kutsut hubin kautta: ei mixed content HTTPS-sivulla
Lisätty GET /api/v1/ollama/tags proxy-endpoint hubiin. Poistettu suorat http://hostname:11434 -kutsut frontendistä. Hub välittää Ollama-kutsut sisäisessä Docker-verkossa. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2830,19 +2830,11 @@ ${generatedFiles['Dockerfile'] || '(puuttuu)'}`;
|
||||
if (content) content.textContent = spinFrames[spinIdx] + ' Ladataan ' + selected.name + '...';
|
||||
}, 100);
|
||||
// Vaihdetaan malli hubille + Ollama pull
|
||||
Promise.all([
|
||||
fetch('/api/v1/model', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ model: selected.name }),
|
||||
}).then(r => r.json()),
|
||||
// Suora pull Ollamasta — odotetaan kunnes malli on ladattu
|
||||
fetch('http://' + window.location.hostname + ':11434/api/pull', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name: selected.name, stream: false }),
|
||||
}).then(r => r.json()).catch(() => ({ status: 'ok' })),
|
||||
]).then(([hubData, _]) => {
|
||||
fetch('/api/v1/model', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ model: selected.name }),
|
||||
}).then(r => r.json()).then(hubData => {
|
||||
clearInterval(spinTimer);
|
||||
pullLine.remove();
|
||||
if (hubData.status === 'ok') {
|
||||
@@ -2878,7 +2870,7 @@ ${generatedFiles['Dockerfile'] || '(puuttuu)'}`;
|
||||
// Haetaan ladatut mallit Ollamasta
|
||||
Promise.all([
|
||||
fetch('/api/v1/hardware').then(r => r.json()).catch(() => ({})),
|
||||
fetch('http://' + window.location.hostname + ':11434/api/tags').then(r => r.json()).catch(() => ({ models: [] })),
|
||||
fetch('/api/v1/ollama/tags').then(r => r.json()).catch(() => ({ models: [] })),
|
||||
]).then(([hw, ollama]) => {
|
||||
const loadedNames = (ollama.models || []).map(m => m.name.replace(':latest', ''));
|
||||
const btn = document.getElementById('agent-compute-btn');
|
||||
|
||||
Reference in New Issue
Block a user