fix: handle local storage quota for model cache

This commit is contained in:
Luca Sacchi Ricciardi
2026-04-25 16:11:12 +02:00
parent ac2089f921
commit 165ad9c02b
3 changed files with 132 additions and 2 deletions
+31 -1
View File
@@ -296,13 +296,43 @@ class LLMMonitorApp {
detailsModal.setAttribute("aria-hidden", "false");
if (!showData) {
detailsContent.textContent = "Show details are not available for this model.";
detailsContent.textContent = "Loading show details...";
this.loadModelShowDetails(modelName, detailsContent);
return;
}
detailsContent.textContent = JSON.stringify(showData, null, 2);
}
async loadModelShowDetails(modelName, detailsContent) {
try {
const response = await fetch(this.buildApiUrl(`/api/v1/models/${encodeURIComponent(modelName)}/show`));
if (!response.ok) {
throw new Error(`Failed to load show details for ${modelName}`);
}
const showData = await response.json();
if (!this.lastData.models) {
return;
}
if (!this.lastData.models.showByModel) {
this.lastData.models.showByModel = {};
}
this.lastData.models.showByModel[modelName] = showData;
if (this.selectedModelName === modelName) {
detailsContent.textContent = JSON.stringify(showData, null, 2);
}
} catch (error) {
console.error(error);
if (this.selectedModelName === modelName) {
detailsContent.textContent = "Show details are not available for this model.";
}
}
}
hideModelDetails() {
const detailsModal = document.getElementById("model-details-modal");
const detailsDialog = document.getElementById("model-details-dialog");