From 7f2946ccdd8dfd15c457ae452235d32d4bb3b749 Mon Sep 17 00:00:00 2001 From: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> Date: Fri, 20 Jun 2025 13:47:15 +0200 Subject: [PATCH] mantine-ui: add query info warnings display to graph view Followup of https://github.com/prometheus/prometheus/pull/16753 Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> --- web/ui/mantine-ui/src/pages/query/Graph.tsx | 40 ++++++++++++++------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/web/ui/mantine-ui/src/pages/query/Graph.tsx b/web/ui/mantine-ui/src/pages/query/Graph.tsx index 082fa340d2..5a4b95baa8 100644 --- a/web/ui/mantine-ui/src/pages/query/Graph.tsx +++ b/web/ui/mantine-ui/src/pages/query/Graph.tsx @@ -85,17 +85,31 @@ const Graph: FC = ({ } | null>(null); // Helper function to render warnings. - const renderWarnings = (warnings?: string[]) => { - return warnings?.map((w, idx) => ( - } - > - {w} - - )); + const renderAlerts = (warnings?: string[], infos?: string[]) => { + return ( + <> + {warnings?.map((w, idx) => ( + } + > + {w} + + ))} + {infos?.map((w, idx) => ( + } + > + {w} + + ))} + + ); }; useEffect(() => { @@ -166,7 +180,7 @@ const Graph: FC = ({ }> This query returned no data. - {renderWarnings(dataAndRange.data.warnings)} + {renderAlerts(dataAndRange.data.warnings)} ); } @@ -183,7 +197,7 @@ const Graph: FC = ({ graphing the equivalent instant vector selector instead. )} - {renderWarnings(dataAndRange.data.warnings)} + {renderAlerts(dataAndRange.data.warnings, dataAndRange.data.infos)}