From b0cf6e2240906886a41b007b09e8740eb4c57e7b Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sun, 1 Feb 2026 15:41:05 +0100 Subject: [PATCH] fix(ollama): Show start prompt when Ollama is not running Instead of showing clickable model suggestions when Ollama is stopped, display a helpful message prompting the user to start Ollama first. Co-Authored-By: Claude Opus 4.5 --- .../luci-static/resources/view/ollama/dashboard.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/secubox/luci-app-ollama/htdocs/luci-static/resources/view/ollama/dashboard.js b/package/secubox/luci-app-ollama/htdocs/luci-static/resources/view/ollama/dashboard.js index 551e54b0..f16dfbeb 100644 --- a/package/secubox/luci-app-ollama/htdocs/luci-static/resources/view/ollama/dashboard.js +++ b/package/secubox/luci-app-ollama/htdocs/luci-static/resources/view/ollama/dashboard.js @@ -98,6 +98,7 @@ return view.extend({ var self = this; var status = data[0] || {}; var models = (data[1] && data[1].models) || []; + this.isRunning = status.running; var view = E('div', { 'class': 'ol-wrap' }, [ E('style', {}, this.css), @@ -222,6 +223,16 @@ return view.extend({ renderModels: function(models) { var self = this; if (!models || models.length === 0) { + // If Ollama isn't running, show start prompt instead of suggestions + if (!this.isRunning) { + return E('div', {}, [ + E('div', { 'class': 'ol-empty' }, [ + E('div', { 'style': 'font-size: 2rem; margin-bottom: 0.5rem;' }, '\u26A0\uFE0F'), + E('div', {}, 'Ollama is not running'), + E('div', { 'style': 'margin-top: 0.5rem; font-size: 0.85rem;' }, 'Click "Start" above to launch Ollama') + ]) + ]); + } return E('div', {}, [ E('div', { 'class': 'ol-empty' }, 'No models installed'), E('div', { 'class': 'ol-suggest' }, [ @@ -258,6 +269,7 @@ return view.extend({ ]).then(function(data) { var status = data[0] || {}; var models = (data[1] && data[1].models) || []; + self.isRunning = status.running; var badge = document.getElementById('ol-status'); if (badge) {