Skip to content

Commit

Permalink
Update metric view data handling in MonitorMetrics component
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Dec 19, 2024
1 parent e2cbd4d commit 8180fcf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dashboard/src/Components/Monitor/MonitorMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ const MonitorMetricsElement: FunctionComponent<ComponentProps> = (
const monitorMetricTypesByMonitor: Array<MonitorMetricType> =
MonitorMetricTypeUtil.getMonitorMetricTypesByMonitorType(monitorType);



// set it to past 1 hour
const endDate: Date = OneUptimeDate.getCurrentDate();
const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -1);
Expand Down Expand Up @@ -276,7 +274,6 @@ const MonitorMetricsElement: FunctionComponent<ComponentProps> = (
formulaConfigs: [],
});


if (isLoading) {
return <PageLoader isVisible={true} />;
}
Expand All @@ -295,7 +292,11 @@ const MonitorMetricsElement: FunctionComponent<ComponentProps> = (
data={metricViewData}
hideQueryElements={true}
onChange={(data: MetricViewData) => {
setMetricViewData(data);
setMetricViewData({
...data,
queryConfigs: getQueryConfigByMonitorMetricTypes(),
formulaConfigs: [],
});
}}
/>
</div>
Expand Down

0 comments on commit 8180fcf

Please sign in to comment.