fix:
- _fetch_loaded_models_internal now writes _loaded_error_cache[endpoint] = time.time() on /api/ps or /v1/models failure, and clears the entry on success - choose_endpoint now filters out candidates with a fresh (<300s) loaded-models error. - /health now probes both /api/version and /api/ps for Ollama endpoints - dashboard adaption relates to #83
This commit is contained in:
parent
0b64a84e96
commit
db6aa73903
4 changed files with 251 additions and 90 deletions
|
|
@ -192,6 +192,10 @@
|
|||
color: #8b0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.status-error[title] {
|
||||
cursor: help;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
.copy-link,
|
||||
.delete-link,
|
||||
.show-link,
|
||||
|
|
@ -736,6 +740,16 @@ function renderTimeSeriesChart(timeSeriesData, chart, minutes) {
|
|||
return await resp.json();
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
if (value === null || value === undefined) return "";
|
||||
return String(value)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function toggleDarkMode() {
|
||||
document.documentElement.classList.toggle("dark-mode");
|
||||
}
|
||||
|
|
@ -752,40 +766,24 @@ function renderTimeSeriesChart(timeSeriesData, chart, minutes) {
|
|||
// Build HTML for both endpoints and llama_server_endpoints
|
||||
let html = "";
|
||||
|
||||
// Add Ollama endpoints
|
||||
html += data.endpoints
|
||||
.map((e) => {
|
||||
const statusClass =
|
||||
e.status === "ok"
|
||||
? "status-ok"
|
||||
: "status-error";
|
||||
const version = e.version || "N/A";
|
||||
return `
|
||||
const renderRow = (e) => {
|
||||
const statusClass =
|
||||
e.status === "ok" ? "status-ok" : "status-error";
|
||||
const version = e.version || "N/A";
|
||||
const titleAttr = e.detail
|
||||
? ` title="${escapeHtml(e.detail)}"`
|
||||
: "";
|
||||
return `
|
||||
<tr>
|
||||
<td class="endpoint">${e.url}</td>
|
||||
<td class="status ${statusClass}">${e.status}</td>
|
||||
<td class="version">${version}</td>
|
||||
<td class="endpoint">${escapeHtml(e.url)}</td>
|
||||
<td class="status ${statusClass}"${titleAttr}>${escapeHtml(e.status)}</td>
|
||||
<td class="version">${escapeHtml(version)}</td>
|
||||
</tr>`;
|
||||
})
|
||||
.join("");
|
||||
|
||||
// Add llama-server endpoints
|
||||
};
|
||||
|
||||
html += data.endpoints.map(renderRow).join("");
|
||||
if (data.llama_server_endpoints && data.llama_server_endpoints.length > 0) {
|
||||
html += data.llama_server_endpoints
|
||||
.map((e) => {
|
||||
const statusClass =
|
||||
e.status === "ok"
|
||||
? "status-ok"
|
||||
: "status-error";
|
||||
const version = e.version || "N/A";
|
||||
return `
|
||||
<tr>
|
||||
<td class="endpoint">${e.url}</td>
|
||||
<td class="status ${statusClass}">${e.status}</td>
|
||||
<td class="version">${version}</td>
|
||||
</tr>`;
|
||||
})
|
||||
.join("");
|
||||
html += data.llama_server_endpoints.map(renderRow).join("");
|
||||
}
|
||||
|
||||
body.innerHTML = html;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue