Skip to content

Commit 6fc9289

Browse files
authored
Merge pull request pyrra-dev#1137 from pyrra-dev/release-0.7-requests-absolute
ui: RequestsGraph shows absolute and relative data
2 parents 70c5c40 + 6aa0581 commit 6fc9289

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ui/src/components/graphs/RequestsGraph.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface RequestsGraphProps {
2323
uPlotCursor: uPlot.Cursor
2424
type: ObjectiveType
2525
updateTimeRange: (min: number, max: number, absolute: boolean) => void
26+
absolute: boolean
2627
}
2728

2829
const RequestsGraph = ({
@@ -33,6 +34,7 @@ const RequestsGraph = ({
3334
uPlotCursor,
3435
type,
3536
updateTimeRange,
37+
absolute = false,
3638
}: RequestsGraphProps): JSX.Element => {
3739
const targetRef = useRef() as React.MutableRefObject<HTMLDivElement>
3840

@@ -115,7 +117,7 @@ const RequestsGraph = ({
115117
query,
116118
)}&g0.range_input=${formatDuration(to - from)}&g0.tab=0`}>
117119
<IconExternal height={20} width={20} />
118-
<span>Prometheus</span>
120+
Prometheus
119121
</a>
120122
</div>
121123
<div>
@@ -146,7 +148,7 @@ const RequestsGraph = ({
146148
x: {min: from / 1000, max: to / 1000},
147149
y: {
148150
range: {
149-
min: {hard: 0},
151+
min: absolute ? {hard: 0, mode: 1, soft: 0} : {hard: 0},
150152
max: {},
151153
},
152154
},

ui/src/pages/Detail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ const Detail = () => {
385385
uPlotCursor={uPlotCursor}
386386
type={objectiveType}
387387
updateTimeRange={updateTimeRangeSelect}
388+
absolute={absolute}
388389
/>
389390
) : (
390391
<></>

0 commit comments

Comments
 (0)