import cx from "classnames" import React from "react" import { apiFetch } from "src/api" import { NodeData, NodeUpdate } from "src/hooks/node-data" // TODO(tailscale/corp#13775): legacy.tsx contains a set of components // that (crudely) implement the pre-2023 web client. These are implemented // purely to ease migration to the new React-based web client, and will // eventually be completely removed. export default function LegacyClientView({ data, refreshData, updateNode, }: { data: NodeData refreshData: () => void updateNode: (update: NodeUpdate) => void }) { return (
{data.Status === "NeedsMachineAuth" ? (
This device is authorized, but needs approval from a network admin before it can connect to the network.
) : ( <>

You are connected! Access this device over Tailscale using the device name or IP address above.

)}
) } export function Header({ data, refreshData, updateNode, }: { data: NodeData refreshData: () => void updateNode: (update: NodeUpdate) => void }) { return (
{data.Profile && data.Status !== "NoState" && data.Status !== "NeedsLogin" && ( <>

{data.Profile.LoginName}

{" "} |{" "} {" "} |{" "}
{data.Profile.ProfilePicURL ? (
) : (
)}
)}
) } export function IP(props: { data: NodeData }) { const { data } = props if (!data.IP) { return null } return ( <>

{data.DeviceName || "Your device"}

{data.IP}

Debug info: Tailscale {data.IPNVersion}, tun={data.TUNMode.toString()} {data.IsSynology && ( <> , DSM{data.DSMVersion} {data.TUNMode || ( <> {" "} ( outgoing access not configured ) )} )}

) }