diff --git a/src/app/(remote-access)/peer/rdp/page.tsx b/src/app/(remote-access)/peer/rdp/page.tsx
index f760fb5..0a40cfd 100644
--- a/src/app/(remote-access)/peer/rdp/page.tsx
+++ b/src/app/(remote-access)/peer/rdp/page.tsx
@@ -4,6 +4,7 @@ import { notify } from "@components/Notification";
import FullScreenLoading from "@components/ui/FullScreenLoading";
import { IconCircleX } from "@tabler/icons-react";
import useFetchApi from "@utils/api";
+import { cn } from "@utils/helpers";
import { Loader2Icon } from "lucide-react";
import React, { useCallback, useEffect, useRef, useState } from "react";
import type { Peer } from "@/interfaces/Peer";
@@ -19,7 +20,6 @@ import {
NetBirdStatus,
useNetBirdClient,
} from "@/modules/remote-access/useNetBirdClient";
-import { cn } from "@utils/helpers";
export default function RDPPage() {
const { peerId } = useRDPQueryParams();
@@ -55,7 +55,7 @@ function RDPSession({ peer }: Props) {
useEffect(() => {
document.title = `${peer.name} - ${peer.ip} - RDP`;
- }, []);
+ }, [peer.ip, peer.name, connected, rdp]);
const sendErrorNotification = (title: string, message: string) => {
notify({
@@ -104,6 +104,7 @@ function RDPSession({ peer }: Props) {
port: credentials.port,
username: credentials.username,
password: credentials.password,
+ domain: credentials.domain,
width: window.innerWidth,
height: window.innerHeight,
});
diff --git a/src/app/(remote-access)/peer/ssh/page.tsx b/src/app/(remote-access)/peer/ssh/page.tsx
index c1f73dc..23db5bc 100644
--- a/src/app/(remote-access)/peer/ssh/page.tsx
+++ b/src/app/(remote-access)/peer/ssh/page.tsx
@@ -2,6 +2,7 @@
import { PageNotFound } from "@components/ui/PageNotFound";
import useFetchApi, { ErrorResponse } from "@utils/api";
+import { isNativeSSHSupported } from "@utils/version";
import { CircleXIcon, InfoIcon, Loader2Icon } from "lucide-react";
import React, { useEffect, useRef } from "react";
import type { Peer } from "@/interfaces/Peer";
@@ -86,7 +87,8 @@ function SSHTerminal({ username, port, peer }: Props) {
if (isSSHConnected || isSSHConnecting) return;
connected.current = false;
try {
- const rules = [`tcp/${port}`];
+ const aclPort = isNativeSSHSupported(peer.version) ? "22022" : port;
+ const rules = [`tcp/${aclPort}`];
await client?.connectTemporary(peer.id, rules);
await ssh({
hostname: peer.ip,
@@ -107,7 +109,8 @@ function SSHTerminal({ username, port, peer }: Props) {
if (connected.current) return;
connected.current = true;
try {
- const rules = [`tcp/${port}`];
+ const aclPort = isNativeSSHSupported(peer.version) ? "22022" : port;
+ const rules = [`tcp/${aclPort}`];
await client?.connectTemporary(peer.id, rules);
const res = await ssh({
hostname: peer.ip,
diff --git a/src/assets/ssh/ssh-client.png b/src/assets/ssh/ssh-client.png
new file mode 100644
index 0000000..2d4bf1a
Binary files /dev/null and b/src/assets/ssh/ssh-client.png differ
diff --git a/src/components/PeerGroupSelector.tsx b/src/components/PeerGroupSelector.tsx
index 4510fa6..c26323d 100644
--- a/src/components/PeerGroupSelector.tsx
+++ b/src/components/PeerGroupSelector.tsx
@@ -309,7 +309,7 @@ export function PeerGroupSelector({
"flex items-center gap-2 border-nb-gray-700 flex-wrap h-full"
}
>
- {resource && showResources && (
+ {resource && (
r.id === resource.id)}
diff --git a/src/components/ui/PolicyDirection.tsx b/src/components/ui/PolicyDirection.tsx
index 145184a..415c685 100644
--- a/src/components/ui/PolicyDirection.tsx
+++ b/src/components/ui/PolicyDirection.tsx
@@ -34,31 +34,34 @@ export default function PolicyDirection({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [disabled]);
+ const isNetworkResource =
+ !!destinationResource && destinationResource?.type !== "peer";
+
const topBadgeClass = useMemo(() => {
- if (destinationResource) return "blueDark";
+ if (isNetworkResource) return "blueDark";
if (value === "bi") return "green";
if (value === "in") return "blueDark";
return "gray";
- }, [value, destinationResource]);
+ }, [value, isNetworkResource]);
const topArrowClass = useMemo(() => {
- if (destinationResource) return "fill-sky-500";
+ if (isNetworkResource) return "fill-sky-500";
if (value === "bi") return "fill-green-500";
if (value === "in") return "fill-sky-500";
return "fill-gray-500";
- }, [value, destinationResource]);
+ }, [value, isNetworkResource]);
const bottomBadgeClass = useMemo(() => {
- if (destinationResource) return "gray";
+ if (isNetworkResource) return "gray";
if (value === "bi") return "green";
return "gray";
- }, [value, destinationResource]);
+ }, [value, isNetworkResource]);
const bottomArrowClass = useMemo(() => {
- if (destinationResource) return "fill-gray-500";
+ if (isNetworkResource) return "fill-gray-500";
if (value === "bi") return "fill-green-500";
return "fill-gray-500";
- }, [value, destinationResource]);
+ }, [value, isNetworkResource]);
return (
-