Fix: releases an existing object URL (#433)

This commit is contained in:
Fine0830 2024-11-25 11:26:42 +08:00 committed by GitHub
parent 5c92a46569
commit e164d87209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -37,8 +37,10 @@ export const saveFile = (data: any, name: string) => {
tagA.download = name;
tagA.style.display = "none";
const blob = new Blob([newData]);
tagA.href = URL.createObjectURL(blob);
const url = URL.createObjectURL(blob);
tagA.href = url;
document.body.appendChild(tagA);
tagA.click();
document.body.removeChild(tagA);
URL.revokeObjectURL(url);
};

View File

@ -77,7 +77,7 @@ limitations under the License. -->
}
}
async function queryMetrics() {
const widgets = [];
const widgets: LayoutConfig[] = [];
for (const item of dashboardStore.layout) {
if (item.type === WidgetType.Widget) {
if (!ListChartTypes.includes(item.graph?.type || "")) {