fix: handle local storage quota for model cache
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user