Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeAgo(format(event.emittedAt, "en_US"));
}, 1000);
return () => {
window.clearInterval(timer);
};
}, []);
const eventKindToTitle = (eventKind: string): string => {
eventKind[0].toUpperCase();
const sPart = eventKind.substring(1).replace(/-/g, " ");
return eventKind.substring(0, 1).toUpperCase() + sPart;
};
const borderColor = useColorModeValue(theme.colors.gray["900"], theme.colors.gray["600"]);
const highLightColor = useColorModeValue(theme.colors.gray["50"], theme.colors.gray["700"]);
return (
const timer = setInterval(() => {
setTimeAgo(format(event.emittedAt, "en_US"));
}, 1000);
return () => {
window.clearInterval(timer);
};
}, []);
const eventKindToTitle = (eventKind: string): string => {
eventKind[0].toUpperCase();
const sPart = eventKind.substring(1).replace(/-/g, " ");
return eventKind.substring(0, 1).toUpperCase() + sPart;
};
const borderColor = useColorModeValue(theme.colors.gray["900"], theme.colors.gray["600"]);
const highLightColor = useColorModeValue(theme.colors.gray["50"], theme.colors.gray["700"]);
return (
const Header: FC = ({
initialTitle,
hashtag,
onSettings,
brand = "SUPERSENSE",
lightColor = "teal.200",
darkColor = "teal.700",
}: HeaderProps) => {
const { colorMode, toggleColorMode } = useColorMode();
const bgColor = useColorModeValue(lightColor, darkColor);
const changeColorModeIcon = useColorModeValue(
,
);
return (
const Header: FC = ({
initialTitle,
hashtag,
onSettings,
brand = "SUPERSENSE",
lightColor = "teal.200",
darkColor = "teal.700",
}: HeaderProps) => {
const { colorMode, toggleColorMode } = useColorMode();
const bgColor = useColorModeValue(lightColor, darkColor);
const changeColorModeIcon = useColorModeValue(
,
);
return (
const TableRow = ({
highlight = false,
highlightBg = "primary",
doStripe = false,
doHorizontalBorders = false,
index = 0,
children = false,
...props
}) => {
const { colorMode } = useColorMode();
const theme = useTheme();
let bg = null;
if (highlight) {
bg = `${highlightBg}.${alphaMap[colorMode]}`;
} else if (doStripe && index % 2 !== 0) {
bg = bgStripe[colorMode];
}
const color = highlight ? opposingColor(theme, bg) : null;
const borderProps =
doHorizontalBorders && index !== 0 ? rowBorder[colorMode] : {};
return (
(
{
device,
timeout,
queryLocation,
queryType,
queryVrf,
queryTarget,
index,
resultsComplete,
setComplete
},
ref
) => {
const config = useConfig();
const theme = useTheme();
const { isSm } = useMedia();
const { colorMode } = useColorMode();
let [{ data, loading, error }, refetch] = useAxios({
url: "/api/query/",
method: "post",
data: {
query_location: queryLocation,
query_type: queryType,
query_vrf: queryVrf,
query_target: queryTarget
},
timeout: timeout,
useCache: false
});
const [isOpen, setOpen] = useState(false);
const Meta = () => {
const config = useConfig();
const theme = useTheme();
const [location, setLocation] = useState({});
const title = config?.site_title || "hyperglass";
const description = config?.site_description || "The modern looking glass.";
const siteName = `${title} - ${description}`;
const keywords = config?.site_keywords || [
"hyperglass",
"looking glass",
"lg",
"peer",
"peering",
"ipv4",
"ipv6",
"transit",
"community",
"communities",
"bgp",
const MainTable = ({ children, ...props }) => {
const theme = useTheme();
const { colorMode } = useColorMode();
return (
const EventCard: React.FC = ({ event }: EventCardProps) => {
const [timeAgo, setTimeAgo] = useState(format(event.emittedAt, "en_US"));
const props = useSpring({ opacity: 1, from: { opacity: 0 } });
const theme = useTheme();
useEffect(() => {
const timer = setInterval(() => {
setTimeAgo(format(event.emittedAt, "en_US"));
}, 1000);
return () => {
window.clearInterval(timer);
};
}, []);
const eventKindToTitle = (eventKind: string): string => {
eventKind[0].toUpperCase();
const sPart = eventKind.substring(1).replace(/-/g, " ");
return eventKind.substring(0, 1).toUpperCase() + sPart;
};
const Results = ({
queryLocation,
queryType,
queryVrf,
queryTarget,
setSubmitting,
...props
}) => {
const config = useConfig();
const theme = useTheme();
const { mediaSize } = useMedia();
const matchedVrf =
config.vrfs.filter(v => v.id === queryVrf)[0] ??
config.vrfs.filter(v => v.id === "default")[0];
const [resultsComplete, setComplete] = useState(null);
return (
<>