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 improvements to new networks features #439

Merged
merged 30 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f68bff7
Fix wrong ui state for routing peer modal in networks
heisbrot Jan 9, 2025
67fd256
Add confirmation dialog when blocking users
heisbrot Jan 9, 2025
786efb7
Keep peer sort order when switching pages
heisbrot Jan 9, 2025
1e5824c
Update sidebar navigation order and remove deprecation notice
heisbrot Jan 9, 2025
f81c567
Fix issue when hovering over truncated text in a group badge closes t…
heisbrot Jan 10, 2025
766b2d4
Update group text in network resource modal
heisbrot Jan 10, 2025
4d1428f
Update networks page text
heisbrot Jan 10, 2025
52890c0
Fix line height
heisbrot Jan 10, 2025
4f066b9
Add search to resource table
heisbrot Jan 10, 2025
5672b41
Switch networks flow to create first resources and then add routers
heisbrot Jan 13, 2025
acf0a4e
Merge branch 'fix/networks-masquerade' into feature/networks-improvem…
heisbrot Jan 13, 2025
8b23aa6
Merge branch 'ux/user-blocking-confirmation' into feature/networks-im…
heisbrot Jan 13, 2025
a541b73
Add enabled toggle to routing peers
heisbrot Jan 13, 2025
92eef5f
Add enabled toggle to network resources
heisbrot Jan 13, 2025
449344f
Add resource group modal and adjust tables
heisbrot Jan 13, 2025
a1c3e45
Clarify networks
braginini Jan 14, 2025
2b7b587
Fix not properly aligned horizontal scroll bar
heisbrot Jan 14, 2025
57e71a3
Add option to install netbird after creating a setup key
heisbrot Jan 14, 2025
f3d4dcb
Fix text for install netbird modal
heisbrot Jan 15, 2025
d7268cb
Show resources count in group settings
heisbrot Jan 15, 2025
1a41026
Fix "no results" and "no routing peers" text showing at the same time
heisbrot Jan 15, 2025
33d8295
Fix wording
heisbrot Jan 15, 2025
d37b7e0
Merge branch 'main' into feature/networks-improvements
heisbrot Jan 15, 2025
1d64f3f
Merge branch 'feature/setup-key-install-netbird' into feature/network…
heisbrot Jan 15, 2025
fe41574
Fix resource policy count
heisbrot Jan 16, 2025
d3a8b70
Hide resource count when selection source groups
heisbrot Jan 16, 2025
31db280
Extend networks routing peer modal with option to create a setup key …
heisbrot Jan 16, 2025
5c2dba7
Add option for horizontal stepper
heisbrot Jan 17, 2025
48bf8e0
Generate setup key when installing netbird from routing peer modal
heisbrot Jan 17, 2025
44f28c8
Add confirm dialog to let the user know a one-off setup-key will be c…
heisbrot Jan 20, 2025
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
Show resources count in group settings
heisbrot committed Jan 15, 2025
commit d7268cb77fdd04fd188bd2296af30bfbb53daf9e
30 changes: 27 additions & 3 deletions src/modules/settings/GroupsTable.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import DataTableHeader from "@components/table/DataTableHeader";
import { DataTableRowsPerPage } from "@components/table/DataTableRowsPerPage";
import NoResults from "@components/ui/NoResults";
import { ColumnDef, SortingState } from "@tanstack/react-table";
import { FolderGit2Icon } from "lucide-react";
import { FolderGit2Icon, Layers3Icon } from "lucide-react";
import { usePathname } from "next/navigation";
import React from "react";
import AccessControlIcon from "@/assets/icons/AccessControlIcon";
@@ -138,6 +138,29 @@ export const GroupsTableColumns: ColumnDef<GroupUsage>[] = [
/>
),
},
{
accessorKey: "resources_count",
header: ({ column }) => {
return (
<DataTableHeader
column={column}
tooltip={
<div className={"text-sm normal-case"}>Network Resources</div>
}
>
<Layers3Icon size={12} />
</DataTableHeader>
);
},
cell: ({ row }) => (
<GroupsCountCell
icon={<Layers3Icon size={10} />}
groupName={row.original.name}
text={"Network Resource(s)"}
count={row.original.resources_count}
/>
),
},
{
accessorKey: "users_count",
header: ({ column }) => {
@@ -172,7 +195,8 @@ export const GroupsTableColumns: ColumnDef<GroupUsage>[] = [
row.policies_count > 0 ||
row.routes_count > 0 ||
row.setup_keys_count > 0 ||
row.users_count > 0
row.users_count > 0 ||
row.resources_count > 0
);
},
},
@@ -189,7 +213,7 @@ type Props = {
headingTarget?: HTMLHeadingElement | null;
};

export default function GroupsTable({ headingTarget }: Props) {
export default function GroupsTable({ headingTarget }: Readonly<Props>) {
const groups = useGroupsUsage();
const path = usePathname();

2 changes: 2 additions & 0 deletions src/modules/settings/useGroupsUsage.tsx
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ export interface GroupUsage {
routes_count: number;
setup_keys_count: number;
users_count: number;
resources_count: number;
}

export default function useGroupsUsage() {
@@ -126,6 +127,7 @@ export default function useGroupsUsage() {
id: group.id,
name: group.name,
peers_count: group.peers_count,
resources_count: group.resources_count,
policies_count: policyCount,
nameservers_count: nameserverCount,
routes_count: routeCount,