mirror of
https://github.com/netbirdio/dashboard.git
synced 2026-01-26 01:21:04 +00:00
Fix toggle for p2p policies (#501)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import Breadcrumbs from "@components/Breadcrumbs";
|
||||
import { Callout } from "@components/Callout";
|
||||
import InlineLink from "@components/InlineLink";
|
||||
import Paragraph from "@components/Paragraph";
|
||||
import SkeletonTable from "@components/skeletons/SkeletonTable";
|
||||
import { RestrictedAccess } from "@components/ui/RestrictedAccess";
|
||||
import { usePortalElement } from "@hooks/usePortalElement";
|
||||
import useFetchApi from "@utils/api";
|
||||
import { ExternalLinkIcon } from "lucide-react";
|
||||
import { ArrowUpRightIcon, ExternalLinkIcon } from "lucide-react";
|
||||
import React, { lazy, Suspense } from "react";
|
||||
import NetworkRoutesIcon from "@/assets/icons/NetworkRoutesIcon";
|
||||
import PeersProvider from "@/contexts/PeersProvider";
|
||||
@@ -59,6 +60,17 @@ export default function NetworkRoutes() {
|
||||
</InlineLink>
|
||||
in our documentation.
|
||||
</Paragraph>
|
||||
|
||||
<Callout className={"max-w-xl mt-3"} variant={"warning"}>
|
||||
<span>
|
||||
We recommend using the new Networks concept to easier visualise
|
||||
and manage access to your resources.{" "}
|
||||
<InlineLink href={"/networks"}>
|
||||
Go to Networks
|
||||
<ArrowUpRightIcon size={14} />
|
||||
</InlineLink>
|
||||
</span>
|
||||
</Callout>
|
||||
</div>
|
||||
|
||||
<RestrictedAccess hasAccess={permission.routes.read}>
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function RDPPage() {
|
||||
} = useFetchApi<Peer>(`/peers/${peerId}`, true, false, !!peerId);
|
||||
|
||||
return (
|
||||
<div className={"w-screen h-screen overflow-hidden"}>
|
||||
<div className={"w-screen h-screen overflow-hidden fixed inset-0"}>
|
||||
{peerId && peer && !isLoading ? (
|
||||
<RDPSession key={peer.id} peer={peer} />
|
||||
) : (
|
||||
|
||||
@@ -37,6 +37,9 @@ export default function AccessControlActiveCell({ policy }: Readonly<Props>) {
|
||||
if (rule.destinationResource) {
|
||||
rule.destinations = null;
|
||||
}
|
||||
if (rule.sourceResource) {
|
||||
rule.sources = null;
|
||||
}
|
||||
});
|
||||
|
||||
updatePolicy(
|
||||
|
||||
@@ -16,7 +16,9 @@ export default function AccessControlDirectionCell({
|
||||
}, [policy]);
|
||||
|
||||
const bidirectional = firstRule ? firstRule.bidirectional : false;
|
||||
const isSingleResource = !!firstRule?.destinationResource;
|
||||
const isSingleResource =
|
||||
!!firstRule?.destinationResource &&
|
||||
firstRule?.destinationResource?.type !== "peer";
|
||||
|
||||
return (
|
||||
<div className={"flex h-full"}>
|
||||
|
||||
@@ -72,6 +72,8 @@ export default function useGroupHelper({ initial = [], peer }: Props) {
|
||||
};
|
||||
|
||||
const removePeerFromGroup = async (g: Group) => {
|
||||
if (g.name === "All") return Promise.resolve(g);
|
||||
|
||||
const newPeerGroups = g.peers?.filter((p) => {
|
||||
const groupPeer = p as GroupPeer;
|
||||
return groupPeer.id !== peer?.id;
|
||||
|
||||
@@ -181,6 +181,7 @@ export const useNetBirdClient = () => {
|
||||
});
|
||||
|
||||
await netBirdClient.current.start();
|
||||
(window as any).netbird = netBirdClient.current;
|
||||
netBirdStore.setState({ status: NetBirdStatus.CONNECTED });
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -203,6 +204,7 @@ export const useNetBirdClient = () => {
|
||||
netBirdStore.setState({ status: NetBirdStatus.DISCONNECTED });
|
||||
await netBirdClient.current.stop();
|
||||
netBirdClient.current = null;
|
||||
delete (window as any).netbird;
|
||||
return Promise.resolve();
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -79,23 +79,13 @@ export default function MacOSTab({
|
||||
</div>
|
||||
<div className={"flex gap-4 mt-1 flex-wrap"}>
|
||||
<Link
|
||||
href={"https://pkgs.netbird.io/macos/arm64"}
|
||||
href={"https://pkgs.netbird.io/macos/universal"}
|
||||
passHref
|
||||
target={"_blank"}
|
||||
>
|
||||
<Button variant={"primary"}>
|
||||
<DownloadIcon size={14} />
|
||||
Download for Apple Silicon
|
||||
</Button>
|
||||
</Link>
|
||||
<Link
|
||||
href={"https://pkgs.netbird.io/macos/amd64"}
|
||||
passHref
|
||||
target={"_blank"}
|
||||
>
|
||||
<Button variant={"outline"}>
|
||||
<DownloadIcon size={14} />
|
||||
Download for Intel
|
||||
Download NetBird
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user