From ccc7d9956559d2195e20345e7a794662b52cd403 Mon Sep 17 00:00:00 2001 From: Agando Date: Sat, 6 Jun 2026 06:00:27 +0200 Subject: auto: 2026-06-06_06:00 changes --- modules/core/module-ollama.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/core/module-ollama.js') diff --git a/modules/core/module-ollama.js b/modules/core/module-ollama.js index ba8ad57..aec52d4 100644 --- a/modules/core/module-ollama.js +++ b/modules/core/module-ollama.js @@ -30,9 +30,8 @@ class OllamaModule { this.terminal.updateOllamaStatus(); }; this.commands['ollamamodels'] = () => { - const models = this.terminal.ollamaManager.getModels(); - if(models.length === 0) return this.terminal.print("No models found. Connect first."); - models.forEach(m => this.terminal.print(`${m.name} (${(m.size/1e9).toFixed(1)}GB)`)); + // Redirect to the consolidated models command + this.listModels(); }; this.commands['ollamasetmodel'] = (args) => { if(!args[0]) return this.terminal.print("Usage: ollamasetmodel ", 'warning'); @@ -62,7 +61,7 @@ class OllamaModule { this.commands['model-run'] = (args) => this.runModel(args); } async listModels() { - const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; + const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; try { const response = await fetch(`${endpoint}/api/tags`); if (!response.ok) throw new Error(`HTTP ${response.status}`); @@ -95,7 +94,7 @@ class OllamaModule { if (!args[0]) { this.terminal.print("Usage: model-info ", "warning"); return; } - const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; + const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; try { const response = await fetch(`${endpoint}/api/show`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, -- cgit v1.2.3