Skip to content

Commit

Permalink
Merge pull request #1137 from pyrra-dev/release-0.7-requests-absolute
Browse files Browse the repository at this point in the history
ui: RequestsGraph shows absolute and relative data
  • Loading branch information
metalmatze authored Apr 10, 2024
2 parents 70c5c40 + 6aa0581 commit 6fc9289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/src/components/graphs/RequestsGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface RequestsGraphProps {
uPlotCursor: uPlot.Cursor
type: ObjectiveType
updateTimeRange: (min: number, max: number, absolute: boolean) => void
absolute: boolean
}

const RequestsGraph = ({
Expand All @@ -33,6 +34,7 @@ const RequestsGraph = ({
uPlotCursor,
type,
updateTimeRange,
absolute = false,
}: RequestsGraphProps): JSX.Element => {
const targetRef = useRef() as React.MutableRefObject<HTMLDivElement>

Expand Down Expand Up @@ -115,7 +117,7 @@ const RequestsGraph = ({
query,
)}&g0.range_input=${formatDuration(to - from)}&g0.tab=0`}>
<IconExternal height={20} width={20} />
<span>Prometheus</span>
Prometheus
</a>
</div>
<div>
Expand Down Expand Up @@ -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: {},
},
},
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ const Detail = () => {
uPlotCursor={uPlotCursor}
type={objectiveType}
updateTimeRange={updateTimeRangeSelect}
absolute={absolute}
/>
) : (
<></>
Expand Down

0 comments on commit 6fc9289

Please sign in to comment.