import React from "react" import { AuthResponse, AuthType } from "src/hooks/auth" import { NodeData } from "src/hooks/node-data" import { ReactComponent as ConnectedDeviceIcon } from "src/icons/connected-device.svg" import { ReactComponent as TailscaleLogo } from "src/icons/tailscale-logo.svg" import ProfilePic from "src/ui/profile-pic" /** * ReadonlyClientView is rendered when the web interface is either * * 1. being viewed by a user not allowed to manage the node * (e.g. user does not own the node) * * 2. or the user is allowed to manage the node but does not * yet have a valid browser session. */ export default function ReadonlyClientView({ data, auth, newSession, }: { data: NodeData auth?: AuthResponse newSession: () => Promise }) { return ( <>
Managed by
{/* TODO(sonia): support tagged node profile view more eloquently */} {data.Profile.LoginName}
{data.DeviceName}
{data.IP}
{auth?.authNeeded == AuthType.tailscale ? ( ) : ( window.location.hostname != data.IP && ( // TODO: check connectivity to tailscale IP ) )}
) }