Skip to content

Commit

Permalink
[Stack Monitoring] Fix index detail page when viewing data via ccs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort authored Apr 28, 2022
1 parent 0c5dbca commit 2f3f919
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clust
const { index }: { index: string } = useParams();
const { zoomInfo, onBrush } = useCharts();
const clusterUuid = globalState.cluster_uuid;
const ccs = globalState.ccs;
const [data, setData] = useState({} as any);
const [alerts, setAlerts] = useState<AlertsByName>({});

Expand Down Expand Up @@ -60,6 +61,7 @@ export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clust
const response = await services.http?.fetch(url, {
method: 'POST',
body: JSON.stringify({
ccs,
timeRange: {
min: bounds.min.toISOString(),
max: bounds.max.toISOString(),
Expand All @@ -84,7 +86,7 @@ export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clust
});
setAlerts(alertsResponse);
}
}, [clusterUuid, services.data?.query.timefilter.timefilter, services.http, index]);
}, [services.data?.query.timefilter.timefilter, services.http, clusterUuid, index, ccs]);

return (
<ItemTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) =
const { index }: { index: string } = useParams();
const { zoomInfo, onBrush } = useCharts();
const clusterUuid = globalState.cluster_uuid;
const ccs = globalState.ccs;
const [data, setData] = useState({} as any);
const [indexLabel, setIndexLabel] = useState(labels.index as any);
const [nodesByIndicesData, setNodesByIndicesData] = useState([]);
Expand Down Expand Up @@ -72,6 +73,7 @@ export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) =
const response = await services.http?.fetch<{ shards: unknown[]; nodes: unknown[] }>(url, {
method: 'POST',
body: JSON.stringify({
ccs,
timeRange: {
min: bounds.min.toISOString(),
max: bounds.max.toISOString(),
Expand Down Expand Up @@ -103,7 +105,7 @@ export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) =
});
setAlerts(alertsResponse);
}
}, [clusterUuid, services.data?.query.timefilter.timefilter, services.http, index]);
}, [services.data?.query.timefilter.timefilter, services.http, clusterUuid, index, ccs]);

return (
<ItemTemplate
Expand Down

0 comments on commit 2f3f919

Please sign in to comment.