This commit is contained in:
Qiuxia Fan 2022-03-26 21:21:32 +08:00
parent 37aab6f41f
commit 169047c59e

View File

@ -398,7 +398,7 @@ function deleteItem(index: number) {
items.splice(index, 1); items.splice(index, 1);
updateSettings(); updateSettings();
} }
function updateSettings(config?: { [key: string]: MetricConfigOpt[] }) { function updateSettings(metricConfig?: { [key: string]: MetricConfigOpt[] }) {
const metrics = legend.metric.filter( const metrics = legend.metric.filter(
(d: any) => d.name && d.value && d.condition (d: any) => d.name && d.value && d.condition
); );
@ -412,7 +412,7 @@ function updateSettings(config?: { [key: string]: MetricConfigOpt[] }) {
linkClientMetrics: states.linkClientMetrics, linkClientMetrics: states.linkClientMetrics,
nodeMetrics: states.nodeMetrics, nodeMetrics: states.nodeMetrics,
legend: metrics, legend: metrics,
...config, ...metricConfig,
}; };
dashboardStore.selectWidget(param); dashboardStore.selectWidget(param);
dashboardStore.setConfigs(param); dashboardStore.setConfigs(param);