diff --git a/app/web/static/js/models-running.js b/app/web/static/js/models-running.js index 538282a..94e4ab7 100644 --- a/app/web/static/js/models-running.js +++ b/app/web/static/js/models-running.js @@ -86,6 +86,10 @@ class RunningModelsPage { } if (!runningData) { + if (!this.lastRunningData) { + this.renderStats([], health?.timestamp || null); + this.renderRunningUnavailable(health); + } return; } @@ -134,11 +138,7 @@ class RunningModelsPage { this.renderStats(models, runningData.timestamp); this.renderRunningModels(models); } catch (error) { - container.innerHTML = ` -
-

Failed to load ollama ps output

-
- `; + this.renderRunningUnavailable(null); this.renderStats([], null); console.error(error); } @@ -244,6 +244,21 @@ class RunningModelsPage { .join(""); } + renderRunningUnavailable(health = null) { + const container = document.getElementById("running-models"); + if (!container) { + return; + } + + const isOffline = health?.ollama_status === "offline"; + container.innerHTML = ` +
+

${isOffline ? "Selected server is offline." : "Failed to load ollama ps output."}

+

Data will refresh automatically when the server becomes reachable.

+
+ `; + } + renderModelCard(model) { const name = this.escapeHtml(model.name || "unknown"); const modelId = this.escapeHtml(model.model || "-");