From 6aa05817868526fc44b195123eb4ab164ac3abeb Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Wed, 10 Apr 2024 16:38:11 +0200 Subject: [PATCH] ui: RequestsGraph shows absolute and relative data --- ui/src/components/graphs/RequestsGraph.tsx | 6 ++++-- ui/src/pages/Detail.tsx | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/components/graphs/RequestsGraph.tsx b/ui/src/components/graphs/RequestsGraph.tsx index 4a718c17..9ece60e6 100644 --- a/ui/src/components/graphs/RequestsGraph.tsx +++ b/ui/src/components/graphs/RequestsGraph.tsx @@ -23,6 +23,7 @@ interface RequestsGraphProps { uPlotCursor: uPlot.Cursor type: ObjectiveType updateTimeRange: (min: number, max: number, absolute: boolean) => void + absolute: boolean } const RequestsGraph = ({ @@ -33,6 +34,7 @@ const RequestsGraph = ({ uPlotCursor, type, updateTimeRange, + absolute = false, }: RequestsGraphProps): JSX.Element => { const targetRef = useRef() as React.MutableRefObject @@ -115,7 +117,7 @@ const RequestsGraph = ({ query, )}&g0.range_input=${formatDuration(to - from)}&g0.tab=0`}> - Prometheus + Prometheus
@@ -146,7 +148,7 @@ const RequestsGraph = ({ x: {min: from / 1000, max: to / 1000}, y: { range: { - min: {hard: 0}, + min: absolute ? {hard: 0, mode: 1, soft: 0} : {hard: 0}, max: {}, }, }, diff --git a/ui/src/pages/Detail.tsx b/ui/src/pages/Detail.tsx index 3bb8eec2..f16c0c34 100644 --- a/ui/src/pages/Detail.tsx +++ b/ui/src/pages/Detail.tsx @@ -385,6 +385,7 @@ const Detail = () => { uPlotCursor={uPlotCursor} type={objectiveType} updateTimeRange={updateTimeRangeSelect} + absolute={absolute} /> ) : ( <>