Skip to content

Commit

Permalink
fix: metrics series request and switch button
Browse files Browse the repository at this point in the history
  • Loading branch information
jacovinus committed Nov 27, 2024
1 parent 344a884 commit a52c1cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export function useMetricsList(id: any, value: any, start, stop) {
const url = `${dataSource.url}/api/v1/series?start=${timeParams.start}&end=${timeParams.end}&${valueFormatter}`;
const apiRequest = async () => {
try {
const req = await axios.get(url, metricsHeaders);
const req = await axios.get(url, {
...metricsHeaders.options,
});
if (req?.status === 200) {
setMetricNames(req?.data?.data || []);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export function useValuesFromMetrics(id: any, start, stop) {
// setLoading(true);

try {
const req = await axios.get(url, metricsHeaders);
const req = await axios.get(url, {
...metricsHeaders.options,
});
if (req?.status === 200) {
setMetricNames(req?.data?.data || []);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export function useMetricsList(id: string, value: string, start, stop) {
const url = `${dataSource.url}/api/v1/series?start=${timeParams.start}&end=${timeParams.end}&${valueFormatter}`;
const apiRequest = async () => {
try {
const req = await axios.get(url, metricsHeaders);
const req = await axios.get(url, {
...metricsHeaders.options,
});
if (req?.status === 200) {
setMetricNames(req?.data?.data || []);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from "@emotion/styled";
import { useEffect, useMemo, useState } from "react";
import { type QrynTheme } from "@ui/theme/types";
const Label: any = styled.div`
color: ${(props: any) => props.theme.contrast};
background: ${(props: any) => props.theme.shadow};
Expand All @@ -22,14 +23,12 @@ const QuerySwitchCont: any = styled.div`
margin-right: 10px;
`;

const QuerySwitchBtn: any = styled.div`
const QuerySwitchBtn: any = styled.div<{ theme: QrynTheme; selected: boolean }>`
cursor: pointer;
display: flex;
align-items: center;
background: ${(props: any) =>
props.selected
? props.theme.neutral
: props.theme.shadow};
background: ${(props) =>
props.selected ? props.theme.alphaPlusNeutral : props.theme.shadow};
border-left: ${(props: any) =>
props.position === "last"
? `1px solid ${props.theme.accentNeutral}`
Expand All @@ -42,8 +41,8 @@ const QuerySwitchBtn: any = styled.div`
position === "first"
? "3px 0px 0px 3px"
: position === "last"
? "0px 3px 3px 0px"
: "0px"};
? "0px 3px 3px 0px"
: "0px"};
flex: 1;
height: 90%;
Expand Down

0 comments on commit a52c1cc

Please sign in to comment.