mirror of
https://github.com/netbirdio/dashboard.git
synced 2026-01-26 01:21:04 +00:00
Enable SSH for Windows and Android peers (#532)
* Enable SSH for Windows and Android peers, hide update badge for temporary peers * Fix RDP to use tcp protocol instead of netbird-ssh
This commit is contained in:
@@ -20,7 +20,6 @@ import {
|
||||
useNetBirdClient,
|
||||
} from "@/modules/remote-access/useNetBirdClient";
|
||||
import { cn } from "@utils/helpers";
|
||||
import { isNetbirdSSHProtocolSupported } from "@utils/version";
|
||||
|
||||
export default function RDPPage() {
|
||||
const { peerId } = useRDPQueryParams();
|
||||
@@ -85,11 +84,8 @@ function RDPSession({ peer }: Props) {
|
||||
try {
|
||||
setCredentials(rdpCredentials);
|
||||
setIsNetBirdConnecting(true);
|
||||
const protocol = isNetbirdSSHProtocolSupported(peer.version)
|
||||
? "netbird-ssh"
|
||||
: "tcp";
|
||||
await client.connectTemporary(peer.id, [
|
||||
`${protocol}/${rdpCredentials.port}`,
|
||||
`tcp/${rdpCredentials.port}`,
|
||||
]);
|
||||
setIsNetBirdConnecting(false);
|
||||
} catch (error) {
|
||||
|
||||
@@ -20,11 +20,13 @@ type Props = {
|
||||
version: string;
|
||||
os: string;
|
||||
serial?: string;
|
||||
ephemeral?: boolean;
|
||||
};
|
||||
export default function PeerVersionCell({ version, os, serial }: Props) {
|
||||
export default function PeerVersionCell({ version, os, serial, ephemeral }: Props) {
|
||||
const { latestVersion, latestUrl } = useApplicationContext();
|
||||
|
||||
const updateAvailable = useMemo(() => {
|
||||
if (ephemeral) return false;
|
||||
const operatingSystem = getOperatingSystem(os);
|
||||
if (
|
||||
operatingSystem === OperatingSystem.IOS ||
|
||||
@@ -33,7 +35,7 @@ export default function PeerVersionCell({ version, os, serial }: Props) {
|
||||
return false;
|
||||
if (!latestVersion) return false;
|
||||
return !compareVersions(version, latestVersion);
|
||||
}, [os, version, latestVersion]);
|
||||
}, [os, version, latestVersion, ephemeral]);
|
||||
|
||||
const updateIcon = useMemo(() => {
|
||||
return <ArrowUpCircleIcon size={15} className={"text-netbird"} />;
|
||||
|
||||
@@ -170,6 +170,7 @@ const PeersTableColumns: ColumnDef<Peer>[] = [
|
||||
version={row.original.version}
|
||||
os={row.original.os}
|
||||
serial={row.original.serial_number}
|
||||
ephemeral={row.original.ephemeral}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -26,9 +26,7 @@ export const SSHButton = ({ peer, isDropdown = false }: Props) => {
|
||||
const hasPermission = permission.peers.update;
|
||||
|
||||
const os = getOperatingSystem(peer?.os);
|
||||
const isWindows = os === OperatingSystem.WINDOWS;
|
||||
const isMobile = os === OperatingSystem.ANDROID || os === OperatingSystem.IOS;
|
||||
const isSSHSupported = !isWindows && !isMobile;
|
||||
const isSSHSupported = os !== OperatingSystem.IOS;
|
||||
|
||||
return (
|
||||
isSSHSupported && (
|
||||
|
||||
Reference in New Issue
Block a user