Skip to content

Commit d2046fe

Browse files
authored
Add resource search, unidirectional policies for all/icmp and dns0 template (#479)
1 parent 8e2cbe1 commit d2046fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1800
-585
lines changed

src/app/(dashboard)/peers/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function PeersBlockedView() {
105105
<div className={"px-3 pt-1 pb-8 max-w-3xl w-full"}>
106106
<div
107107
className={
108-
"rounded-md border border-nb-gray-900/70 grid w-full bg-nb-gray-930/40 stepper-bg-variant"
108+
"rounded-md border border-nb-gray-900/70 grid w-full bg-nb-gray-930/40"
109109
}
110110
>
111111
<SetupModalContent header={false} footer={false} />

src/app/globals.css

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ p {
6767
}
6868

6969
.stepper-bg-variant .step-circle {
70-
@apply !border-[#1d2024];
70+
@apply !border-nb-gray-940;
7171
}
7272

7373
.webkit-scroll{
@@ -117,4 +117,43 @@ p {
117117
@keyframes fadeIn {
118118
from { opacity: 0; }
119119
to { opacity: 1; }
120-
}
120+
}
121+
122+
123+
.animate-slow-ping {
124+
animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite
125+
}
126+
127+
@keyframes ping {
128+
75%, 100% {
129+
transform: scale(2);
130+
opacity: 0;
131+
}
132+
}
133+
134+
.animate-slow-pulse {
135+
animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite
136+
}
137+
138+
139+
@keyframes pulse {
140+
60% {
141+
opacity: 0.5;
142+
}
143+
}
144+
145+
@keyframes bg-scroll {
146+
0% {
147+
background-position: 0% 100%;
148+
}
149+
100% {
150+
background-position: 0% 0%;
151+
}
152+
}
153+
154+
.animate-bg-scroll {
155+
animation: bg-scroll 4s linear infinite;
156+
}
157+
.animate-bg-scroll-faster {
158+
animation: bg-scroll 1.8s linear infinite;
159+
}
Lines changed: 12 additions & 0 deletions
Loading

src/assets/nameservers/dns0.svg

Lines changed: 12 additions & 0 deletions
Loading

src/components/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export default function Badge({
6161
<div
6262
className={cn(
6363
"relative z-10 cursor-inherit whitespace-nowrap rounded-md text-[12px] py-1.5 px-3 font-normal flex gap-1.5 items-center justify-center transition-all",
64-
className,
6564
variants({ variant, hover: useHover ? variant : "none" }),
6665
disabled && "cursor-not-allowed opacity-50 select-none",
66+
className,
6767
)}
6868
{...props}
6969
>

src/components/Button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cva, VariantProps } from "class-variance-authority";
44
import classNames from "classnames";
55
import React, { forwardRef } from "react";
66

7-
type ButtonVariants = VariantProps<typeof buttonVariants>;
7+
export type ButtonVariants = VariantProps<typeof buttonVariants>;
88

99
export interface ButtonProps
1010
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
@@ -28,7 +28,7 @@ export const buttonVariants = cva(
2828
"dark:focus:ring-zinc-800/50 dark:bg-nb-gray dark:text-gray-400 dark:border-gray-700/30 dark:hover:text-white dark:hover:bg-zinc-800/50",
2929
],
3030
primary: [
31-
"dark:focus:ring-netbird-600/50 dark:ring-offset-neutral-950/50 enabled:dark:bg-netbird disabled:dark:bg-nb-gray-920 dark:text-gray-100 enabled:dark:hover:text-white enabled:dark:hover:bg-netbird-500/80",
31+
"dark:focus:ring-netbird-600/50 dark:ring-offset-neutral-950/50 enabled:dark:bg-netbird disabled:dark:bg-nb-gray-910 dark:text-gray-100 enabled:dark:hover:text-white enabled:dark:hover:bg-netbird-500/80",
3232
"enabled:bg-netbird enabled:text-white enabled:focus:ring-netbird-400/50 enabled:hover:bg-netbird-500",
3333
],
3434
secondary: [
@@ -49,7 +49,7 @@ export const buttonVariants = cva(
4949
dropdown: [
5050
"bg-white hover:text-black focus:ring-zinc-200/50 hover:bg-gray-100 border-neutral-200 text-gray-900",
5151
"dark:ring-offset-neutral-950/50 dark:focus:ring-neutral-500/20 ",
52-
"dark:bg-nb-gray-900/40 dark:text-gray-400 dark:border-nb-gray-800 dark:hover:bg-nb-gray-900/50",
52+
"dark:bg-nb-gray-900/40 dark:text-gray-400 dark:border-nb-gray-900 dark:hover:bg-nb-gray-900/50",
5353
],
5454
dotted: [
5555
"bg-white hover:text-black focus:ring-zinc-200/50 hover:bg-gray-100 border-gray-200 text-gray-900 border-dashed",

src/components/DatePickerWithRange.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const defaultRanges = {
3434
from: dayjs().subtract(2, "day").startOf("day").toDate(),
3535
to: dayjs().endOf("day").toDate(),
3636
},
37+
last7Days: {
38+
from: dayjs().subtract(7, "day").startOf("day").toDate(),
39+
to: dayjs().endOf("day").toDate(),
40+
},
3741
lastMonth: {
3842
from: dayjs().subtract(1, "month").startOf("day").toDate(),
3943
to: dayjs().endOf("day").toDate(),
@@ -64,6 +68,7 @@ export function DatePickerWithRange({
6468
yesterday: isEqualDateRange(value, defaultRanges.yesterday),
6569
last14Days: isEqualDateRange(value, defaultRanges.last14Days),
6670
last2Days: isEqualDateRange(value, defaultRanges.last2Days),
71+
last7Days: isEqualDateRange(value, defaultRanges.last7Days),
6772
lastMonth: isEqualDateRange(value, defaultRanges.lastMonth),
6873
allTime: isEqualDateRange(value, defaultRanges.allTime),
6974
};
@@ -76,6 +81,7 @@ export function DatePickerWithRange({
7681
if (isActive.lastMonth) return "Last Month";
7782
if (isActive.last14Days) return "Last 14 Days";
7883
if (isActive.last2Days) return "Last 2 Days";
84+
if (isActive.last7Days) return "Last 7 Days";
7985
if (isActive.yesterday) return "Yesterday";
8086
if (isActive.today) return "Today";
8187

@@ -88,12 +94,11 @@ export function DatePickerWithRange({
8894
const [calendarOpen, setCalendarOpen] = useState(false);
8995

9096
const updateRangeAndClose = (range: DateRange) => {
91-
setCalendarOpen(false);
9297
onChange?.(range);
9398
};
9499

95100
const debouncedOnChange = useMemo(() => {
96-
return onChange ? debounce(onChange, 300) : undefined;
101+
return onChange ? debounce(onChange, 500) : undefined;
97102
}, [onChange]);
98103

99104
const handleOnSelect = (range?: DateRange) => {

src/components/FullTooltip.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
TooltipContent,
44
TooltipProvider,
55
TooltipTrigger,
6+
TooltipVariants,
67
} from "@components/Tooltip";
78
import { TooltipProps } from "@radix-ui/react-tooltip";
89
import { cn } from "@utils/helpers";
@@ -24,7 +25,9 @@ type Props = {
2425
customOnOpenChange?: React.Dispatch<React.SetStateAction<boolean>>;
2526
delayDuration?: number;
2627
skipDelayDuration?: number;
27-
} & TooltipProps;
28+
} & TooltipProps &
29+
TooltipVariants;
30+
2831
export default function FullTooltip({
2932
children,
3033
content,
@@ -41,6 +44,7 @@ export default function FullTooltip({
4144
customOnOpenChange,
4245
delayDuration = 1,
4346
skipDelayDuration = 300,
47+
variant = "default",
4448
}: Props) {
4549
const [open, setOpen] = useState(!!keepOpen);
4650

@@ -66,7 +70,7 @@ export default function FullTooltip({
6670
<div
6771
className={cn(
6872
isAction ? "cursor-pointer" : "cursor-default",
69-
"inline-flex items-center gap-2 dark:text-neutral-300 text-neutral-500 hover:text-neutral-100 transition-all hover:bg-nb-gray-800/60 py-2 px-3 rounded-md",
73+
"inline-flex items-center gap-2 dark:text-neutral-300 text-neutral-500 hover:text-neutral-100 transition-all hover:bg-nb-gray-800/60 py-2 px-3 rounded-md",
7074
className,
7175
)}
7276
>
@@ -82,6 +86,7 @@ export default function FullTooltip({
8286
alignOffset={20}
8387
forceMount={true}
8488
className={contentClassName}
89+
variant={variant}
8590
align={align}
8691
side={side}
8792
>

src/components/Kbd.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const variants = cva("", {
1212
variants: {
1313
variant: {
1414
default: ["bg-nb-gray-800 border-nb-gray-700 text-nb-gray-300 "],
15+
darker: ["bg-nb-gray-930 border-nb-gray-900 text-nb-gray-250 "],
1516
netbird: ["bg-netbird-100 text-netbird border-netbird "],
1617
},
1718
size: {
@@ -30,7 +31,7 @@ export default function Kbd({
3031
size = "default",
3132
disabled = false,
3233
className,
33-
}: Props) {
34+
}: Readonly<Props>) {
3435
return (
3536
<div
3637
className={cn(

src/components/NetBirdLogo.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { cn } from "@utils/helpers";
2+
import Image from "next/image";
3+
import * as React from "react";
4+
import NetBirdLogoMark from "@/assets/netbird.svg";
5+
import NetBirdLogoFull from "@/assets/netbird-full.svg";
6+
7+
type Props = {
8+
size?: "default" | "large";
9+
mobile?: boolean;
10+
};
11+
12+
const sizes = {
13+
default: {
14+
desktop: 22,
15+
mobile: 30,
16+
},
17+
large: {
18+
desktop: 24,
19+
mobile: 40,
20+
},
21+
};
22+
23+
export const NetBirdLogo = ({ size = "default", mobile = true }: Props) => {
24+
return (
25+
<>
26+
<Image
27+
src={NetBirdLogoFull}
28+
height={sizes[size].desktop}
29+
alt={"NetBird Logo"}
30+
className={cn(mobile && "hidden md:block")}
31+
/>
32+
{mobile && (
33+
<Image
34+
src={NetBirdLogoMark}
35+
width={sizes[size].mobile}
36+
alt={"NetBird Logo"}
37+
className={cn(mobile && "md:hidden ml-4")}
38+
/>
39+
)}
40+
</>
41+
);
42+
};

0 commit comments

Comments
 (0)