Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region and public ip to peer table and detailed peer view #340

Merged
merged 53 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7c8cb65
Init Dashboard V2
heisbrot Jan 29, 2024
0695d44
Update README.md
heisbrot Jan 29, 2024
ea4a207
use dedicated var and prevent push on PRs
mlsmaycon Jan 29, 2024
dbd3feb
Fix redirect link to event streaming docs
heisbrot Feb 1, 2024
54e66d4
Add iOS operating system icon
heisbrot Feb 2, 2024
90d80c3
Refactor
heisbrot Feb 2, 2024
879d24d
Add autocomplete input
heisbrot Feb 2, 2024
dda557c
Use idtoken source for token
heisbrot Feb 2, 2024
877c0d1
Add posture check modal with checks
heisbrot Feb 2, 2024
707ada6
Fix peer last seen in detail view
heisbrot Feb 6, 2024
b6a777a
Fix last seen date of user
heisbrot Feb 6, 2024
b980047
Add sliding tabs ui component
heisbrot Feb 6, 2024
a819510
Add posture check ui cards
heisbrot Feb 6, 2024
7b27112
Add draft for operating system check ui
heisbrot Feb 8, 2024
9c3b0cb
Add better ui for locations
heisbrot Feb 9, 2024
7169d52
Add better ui for os check
heisbrot Feb 12, 2024
117057d
Merge branch 'main' into feature/posture-checks
heisbrot Feb 12, 2024
22e94a4
Add create posture checks, add select posture check (draft)
heisbrot Feb 13, 2024
6a634fe
Add posture check selection
heisbrot Feb 13, 2024
153a37c
Update posture checks selection modal
heisbrot Feb 13, 2024
a22e800
Add radix radio group
heisbrot Feb 13, 2024
7639f56
Add edit and browse posture checks
heisbrot Feb 14, 2024
ef4f08a
Add posture check cell to access control
heisbrot Feb 14, 2024
0ead53e
Optimize select dropdown performance
heisbrot Feb 14, 2024
e7cb586
Add posture check page
heisbrot Feb 16, 2024
00ff4a9
Update workflow
heisbrot Feb 16, 2024
fe40a5e
Merge branch 'main' into feature/posture-checks
heisbrot Feb 16, 2024
2b79496
Return no results if source_posture_checks is undefined
heisbrot Feb 16, 2024
433bae0
Add flag icons
heisbrot Feb 16, 2024
f1cd664
Add loading indicator and fix some ui issues
heisbrot Feb 16, 2024
085662c
Add loading indicator for country and cities
heisbrot Feb 16, 2024
d70e873
Disable select dropdown while loading
heisbrot Feb 16, 2024
c5564c3
Disable select dropdown while loading, add tooltip for description
heisbrot Feb 16, 2024
3a5799b
Merge branch 'main' into feature/posture-checks
heisbrot Feb 16, 2024
9392e32
Add MaxMind licence information and refactor code
heisbrot Feb 19, 2024
eae8249
Add tooltips for checks, refactor posture check modal
heisbrot Feb 20, 2024
67896ca
Remove unused state
heisbrot Feb 20, 2024
f1b84e6
Disable delete button when posture check is assigned to policies
heisbrot Feb 21, 2024
97e6bac
Add semantic version input validation for operating-system and netbir…
heisbrot Feb 21, 2024
40b6f89
Restore build_and_push.yml
heisbrot Feb 21, 2024
d7fe14f
Fix group badge icon size
heisbrot Feb 22, 2024
cb1d6ce
Fix copy icon size
heisbrot Feb 22, 2024
771dd27
Add region information to peer table and single peer view
heisbrot Feb 22, 2024
d059b77
Merge branch 'main' into feature/peer-region
heisbrot Feb 22, 2024
a2308be
Push to docker
heisbrot Feb 22, 2024
303d2d6
Change login expired icon size
heisbrot Feb 23, 2024
5b114b9
Fix country flag in single peer view
heisbrot Feb 23, 2024
8d74504
Change country flag size in peer table
heisbrot Feb 23, 2024
a6ca799
Disable revalidation for countries
heisbrot Feb 23, 2024
ac6e9b9
Fix icon size on peer detail view
heisbrot Feb 23, 2024
ad5630c
Rollback workflow
heisbrot Feb 23, 2024
d581127
Merge branch 'main' into feature/peer-region
heisbrot Feb 23, 2024
98ba1c6
Revert login expiration
heisbrot Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into feature/posture-checks
# Conflicts:
#	package-lock.json
#	package.json
#	src/app/(dashboard)/access-control/page.tsx
#	src/app/(dashboard)/peer/page.tsx
#	src/app/(dashboard)/team/user/page.tsx
#	src/components/PeerSelector.tsx
#	src/components/SquareIcon.tsx
#	src/components/ToggleSwitch.tsx
#	src/components/VerticalTabs.tsx
#	src/components/modal/Modal.tsx
#	src/components/modal/ModalHeader.tsx
#	src/components/select/SelectDropdown.tsx
#	src/components/ui/UserAvatar.tsx
#	src/contexts/PoliciesProvider.tsx
#	src/hooks/useOperatingSystem.ts
#	src/interfaces/AccessToken.ts
#	src/interfaces/ActivityEvent.ts
#	src/interfaces/Peer.ts
#	src/interfaces/Policy.ts
#	src/interfaces/User.ts
#	src/interfaces/Version.ts
#	src/layouts/Navigation.tsx
#	src/modules/activity/ActivityDescription.tsx
#	src/modules/activity/ActivityEntryRow.tsx
#	src/modules/activity/ActivityUserSelector.tsx
#	src/modules/dns-nameservers/NameserverModal.tsx
#	src/modules/groups/useGroupHelper.tsx
#	src/modules/peers/PeerOSCell.tsx
#	src/modules/routes/RouteModal.tsx
#	src/modules/routes/RouteUpdateModal.tsx
#	src/modules/setup-keys/SetupKeyModal.tsx
#	src/modules/users/ServiceUsersTable.tsx
#	src/modules/users/UserInviteModal.tsx
#	src/modules/users/UsersTable.tsx
#	src/modules/users/table-cells/ServiceUserNameCell.tsx
#	src/modules/users/table-cells/UserActionCell.tsx
#	src/modules/users/table-cells/UserBlockCell.tsx
#	src/modules/users/table-cells/UserNameCell.tsx
#	src/utils/api.tsx
  • Loading branch information
heisbrot committed Feb 12, 2024
commit 117057dfa92f4c4618361a2250734f1e3a8dd780
87 changes: 12 additions & 75 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
Expand All @@ -39,7 +38,7 @@
"autoprefixer": "^10",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.1",
"cmdk": "^0.2.0",
"date-fns": "^2.30.0",
"dayjs": "^1.11.10",
"eslint": "^8",
Expand All @@ -50,7 +49,6 @@
"flowbite-react": "^0.6.4",
"framer-motion": "^10.16.4",
"ip-cidr": "^3.1.0",
"iso-3166": "^4.3.0",
"lodash": "^4.17.21",
"lucide-react": "^0.287.0",
"next": "13.5.5",
Expand All @@ -69,8 +67,7 @@
"swr": "^2.2.4",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5",
"virtua": "^0.25.0"
"typescript": "^5"
},
"devDependencies": {
"cypress": "^13.3.3",
Expand Down
16 changes: 5 additions & 11 deletions src/app/(dashboard)/access-control/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Paragraph from "@components/Paragraph";
import SkeletonTable from "@components/skeletons/SkeletonTable";
import { RestrictedAccess } from "@components/ui/RestrictedAccess";
import useFetchApi from "@utils/api";
import { BookIcon, ExternalLinkIcon } from "lucide-react";
import { ExternalLinkIcon } from "lucide-react";
import React, { lazy, Suspense } from "react";
import AccessControlIcon from "@/assets/icons/AccessControlIcon";
import GroupsProvider from "@/contexts/GroupsProvider";
Expand All @@ -15,7 +15,7 @@ import { Policy } from "@/interfaces/Policy";
import PageContainer from "@/layouts/PageContainer";

const AccessControlTable = lazy(
() => import("@/modules/access-control/rules/table/AccessControlTable"),
() => import("@/modules/access-control/table/AccessControlTable"),
);
export default function AccessControlPage() {
const { data: policies, isLoading } = useFetchApi<Policy[]>("/policies");
Expand All @@ -26,21 +26,15 @@ export default function AccessControlPage() {
<div className={"p-default py-6"}>
<Breadcrumbs>
<Breadcrumbs.Item
href={"/access-control"}
href={"/policies"}
label={"Access Control"}
icon={<AccessControlIcon size={13} />}
/>
<Breadcrumbs.Item
href={"/access-control"}
label={"Rules"}
active
icon={<BookIcon size={14} />}
/>
</Breadcrumbs>
<h1>
{policies && policies.length > 1
? `${policies.length} Access Control Rules`
: "Access Control Rules"}
? `${policies.length} Access Control Policies`
: "Access Control Policies"}
</h1>
<Paragraph>
Create rules to manage access in your network and define what peers
Expand Down
2 changes: 1 addition & 1 deletion src/app/(dashboard)/peer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function PeerOverview() {
<Breadcrumbs.Item label={peer.ip} active />
</Breadcrumbs>

<div className={"flex justify-between max-w-6xl"}>
<div className={"flex justify-between max-w-6xl items-start"}>
<div>
<div className={"flex items-center gap-3"}>
<h1 className={"flex items-center gap-3"}>
Expand Down
28 changes: 15 additions & 13 deletions src/app/(dashboard)/team/user/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function UserOverview({ user }: Props) {
/>
)}

<Breadcrumbs.Item label={user.name} active />
<Breadcrumbs.Item label={user.name || user.id} active />
</Breadcrumbs>

<div className={"flex justify-between max-w-6xl"}>
Expand All @@ -138,18 +138,22 @@ function UserOverview({ user }: Props) {
}
: {
color: user?.name
? generateColorFromString(user?.name || "System User")
? generateColorFromString(
user?.name || user?.id || "System User",
)
: "#808080",
}
}
>
{user.is_service_user ? (
<IconSettings2 size={16} />
) : (
user?.name?.charAt(0)
user?.name?.charAt(0) || user?.id?.charAt(0)
)}
</div>
<h1 className={"flex items-center gap-3"}>{user.name}</h1>
<h1 className={"flex items-center gap-3"}>
{user.name || user.id}
</h1>
</div>
</div>
<div className={"flex gap-4"}>
Expand Down Expand Up @@ -256,10 +260,10 @@ function UserInformationCard({ user }: { user: User }) {
label={
<>
<User2 size={16} />
Name
{user.name ? "Name" : "User ID"}
</>
}
value={user.name}
value={user.name || user.id}
/>

{!isServiceUser && (
Expand All @@ -270,7 +274,7 @@ function UserInformationCard({ user }: { user: User }) {
E-Mail
</>
}
value={user.email}
value={user.email || "-"}
/>
)}

Expand Down Expand Up @@ -303,12 +307,10 @@ function UserInformationCard({ user }: { user: User }) {
</>
}
value={
dayjs(user.last_login).isBefore(dayjs().subtract(1000, "years"))
? "Never"
: dayjs(user.last_login).format("D MMMM, YYYY [at] h:mm A") +
" (" +
dayjs().to(user.last_login) +
")"
dayjs(user.last_login).format("D MMMM, YYYY [at] h:mm A") +
" (" +
dayjs().to(user.last_login) +
")"
}
/>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PeerSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function PeerSelector({

const [dropdownOptions, setDropdownOptions] = useState<Peer[]>([]);
const searchRef = React.useRef<HTMLInputElement>(null);
const [search, setSearch] = useState("");
const [inputRef, { width }] = useElementSize<HTMLButtonElement>();
const [search, setSearch] = useState("");

// Update dropdown options when peers change
useEffect(() => {
Expand Down
18 changes: 3 additions & 15 deletions src/components/VerticalTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,17 @@ function VerticalTabs({ value, onChange, children }: Props) {
);
}

function List({
children,
fullHeight = true,
border = true,
className,
}: {
children: React.ReactNode;
fullHeight?: boolean;
border?: boolean;
className?: string;
}) {
function List({ children }: { children: React.ReactNode }) {
const isLg = useIsLg();
return (
<Tabs.List
className={cn(
"px-4 py-4 whitespace-nowrap overflow-y-hidden shrink-0 no-scrollbar",
"lg:h-full items-start bg-nb-gray border-nb-gray-930",
"lg:h-full items-start bg-nb-gray border-b border-nb-gray-930",
"flex lg:flex-col lg:gap-1",
border && "border-b",
className,
)}
style={{
height: isLg && fullHeight ? "calc(100vh - 75px)" : "auto",
height: isLg ? "calc(100vh - 75px)" : "auto",
}}
>
{children}
Expand Down
6 changes: 3 additions & 3 deletions src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const ModalOverlay = React.forwardRef<
<DialogPrimitive.Overlay
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 dark:bg-neutral-950/70",
"place-items-center overflow-y-auto",
"fixed top-0 left-0 bottom-0 right-0 grid z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 dark:bg-neutral-950/70",
"mx-auto place-items-start overflow-y-auto md:py-16",
className,
)}
{...props}
Expand Down Expand Up @@ -65,7 +65,7 @@ const ModalContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-0 md:top-[5%] z-50 grid w-full translate-x-[-50%] border border-neutral-200 bg-white py-6 dark:shadow-lg shadow-sm duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2 ] sm:rounded-lg md:w-full dark:border-nb-gray-900 dark:bg-nb-gray",
"mx-auto relative top-0 z-50 grid w-full border border-neutral-200 bg-white py-6 dark:shadow-lg shadow-sm duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1 data-[state=open]:slide-in-from-left-1 sm:rounded-lg md:w-full dark:border-nb-gray-900 dark:bg-nb-gray",
className,
maxWidthClass,
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/ModalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ModalHeader({
margin = "mt-0",
}: Props) {
return (
<div className={cn(className, "relative z-[1]")}>
<div className={className}>
<div className={"flex items-start gap-5 pr-10"}>
{icon && <SquareIcon color={color} icon={icon} />}
<div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/UserAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export const UserAvatar = ({ size = "default" }: Props) => {
)}
style={{
color: user?.name
? generateColorFromString(user?.name || "System User")
? generateColorFromString(user?.name || user?.id || "System User")
: "#808080",
}}
>
{user?.name?.charAt(0)}
{user?.name?.charAt(0) || user?.id?.charAt(0)}
</div>
);
};
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.