update dashboard name

This commit is contained in:
Qiuxia Fan 2022-03-28 14:31:42 +08:00
parent d78ca0cd4b
commit f17560decc

View File

@ -219,8 +219,8 @@ async function setMetricType(chart?: any) {
} }
} }
function setDashboards() { function setDashboards(type?: string) {
const { graph } = dashboardStore.selectedGrid; const graph = type || dashboardStore.selectedGrid.graph;
const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]"); const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]");
const arr = list.reduce( const arr = list.reduce(
( (
@ -279,7 +279,7 @@ function changeChartType(item: Option) {
defaultLen.value = 5; defaultLen.value = 5;
} }
setMetricType(graph); setMetricType(graph);
setDashboards(); setDashboards(graph.type);
states.dashboardName = ""; states.dashboardName = "";
defaultLen.value = 10; defaultLen.value = 10;
} }