diff --git a/site/src/components/AppLink/AppLink.stories.tsx b/site/src/components/AppLink/AppLink.stories.tsx index f232870999f0d..845d1e350abc9 100644 --- a/site/src/components/AppLink/AppLink.stories.tsx +++ b/site/src/components/AppLink/AppLink.stories.tsx @@ -15,6 +15,7 @@ WithIcon.args = { workspaceName: MockWorkspace.name, appName: "code-server", appIcon: "/icon/code.svg", + appSharingLevel: "owner", health: "healthy", } @@ -23,6 +24,7 @@ WithoutIcon.args = { username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", + appSharingLevel: "owner", health: "healthy", } @@ -31,6 +33,7 @@ HealthDisabled.args = { username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", + appSharingLevel: "owner", health: "disabled", } diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 10ffaf23e9a5a..50477c08362ee 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -4,6 +4,9 @@ import Link from "@material-ui/core/Link" import { makeStyles } from "@material-ui/core/styles" import Tooltip from "@material-ui/core/Tooltip" import ComputerIcon from "@material-ui/icons/Computer" +import PublicOutlinedIcon from "@material-ui/icons/PublicOutlined" +import LockOutlinedIcon from "@material-ui/icons/LockOutlined" +import GroupOutlinedIcon from "@material-ui/icons/GroupOutlined" import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline" import { FC, PropsWithChildren } from "react" import * as TypesGen from "../../api/typesGenerated" @@ -23,6 +26,7 @@ export interface AppLinkProps { appIcon?: TypesGen.WorkspaceApp["icon"] appCommand?: TypesGen.WorkspaceApp["command"] appSubdomain: TypesGen.WorkspaceApp["subdomain"] + appSharingLevel: TypesGen.WorkspaceApp["sharing_level"] health: TypesGen.WorkspaceApp["health"] } @@ -35,6 +39,7 @@ export const AppLink: FC> = ({ appIcon, appCommand, appSubdomain, + appSharingLevel, health, }) => { const styles = useStyles() @@ -60,36 +65,50 @@ export const AppLink: FC> = ({ ) : ( ) - let tooltip = "" + + let shareIcon = + let shareTooltip = "Private, only accessible by you" + if (appSharingLevel === "authenticated") { + shareIcon = + shareTooltip = "Shared with all authenticated users" + } + if (appSharingLevel === "public") { + shareIcon = + shareTooltip = "Shared publicly" + } + + let primaryTooltip = "" if (health === "initializing") { canClick = false icon = - tooltip = "Initializing..." + primaryTooltip = "Initializing..." } if (health === "unhealthy") { canClick = false icon = - tooltip = "Unhealthy" + primaryTooltip = "Unhealthy" } if (!appsHost && appSubdomain) { canClick = false icon = - tooltip = "Your admin has not configured subdomain application access" + primaryTooltip = + "Your admin has not configured subdomain application access" } const button = ( ) return ( - + ({ notConfiguredIcon: { color: theme.palette.grey[300], }, + + appName: { + marginRight: theme.spacing(1), + }, })) diff --git a/site/src/components/PortForwardButton/PortForwardButton.tsx b/site/src/components/PortForwardButton/PortForwardButton.tsx index 4662c2859726b..4a18681f2f836 100644 --- a/site/src/components/PortForwardButton/PortForwardButton.tsx +++ b/site/src/components/PortForwardButton/PortForwardButton.tsx @@ -64,7 +64,8 @@ const EnabledView: React.FC = (props) => { Access ports running on the agent with the{" "} port, agent name, workspace name and{" "} - your username URL schema, as shown below. + your username URL schema, as shown below. Port URLs are + only accessible by you. diff --git a/site/src/components/Resources/Resources.tsx b/site/src/components/Resources/Resources.tsx index f8833fdc11a8c..9d2e63ac9e39c 100644 --- a/site/src/components/Resources/Resources.tsx +++ b/site/src/components/Resources/Resources.tsx @@ -203,6 +203,7 @@ export const Resources: FC> = ({ appName={app.name} appCommand={app.command} appSubdomain={app.subdomain} + appSharingLevel={app.sharing_level} username={workspace.owner_name} workspaceName={workspace.name} agentName={agent.name}