1
1
import type * as TypesGen from "api/typesGenerated" ;
2
2
import { DropdownMenuItem } from "components/DropdownMenu/DropdownMenu" ;
3
+ import { Link } from "components/Link/Link" ;
3
4
import { Spinner } from "components/Spinner/Spinner" ;
4
5
import {
5
6
Tooltip ,
@@ -11,7 +12,7 @@ import { useProxy } from "contexts/ProxyContext";
11
12
import { CircleAlertIcon } from "lucide-react" ;
12
13
import { isExternalApp , needsSessionToken } from "modules/apps/apps" ;
13
14
import { useAppLink } from "modules/apps/useAppLink" ;
14
- import { type FC , useState } from "react" ;
15
+ import { type FC , type ReactNode , useState } from "react" ;
15
16
import { AgentButton } from "../AgentButton" ;
16
17
import { BaseIcon } from "./BaseIcon" ;
17
18
import { ShareIcon } from "./ShareIcon" ;
@@ -48,7 +49,7 @@ export const AppLink: FC<AppLinkProps> = ({
48
49
// To avoid bugs in the healthcheck code locking users out of apps, we no
49
50
// longer block access to apps if they are unhealthy/initializing.
50
51
let canClick = true ;
51
- let primaryTooltip = "" ;
52
+ let primaryTooltip : ReactNode = "" ;
52
53
let icon = ! iconError && (
53
54
< BaseIcon app = { app } onIconPathError = { ( ) => setIconError ( true ) } />
54
55
) ;
@@ -80,6 +81,28 @@ export const AppLink: FC<AppLinkProps> = ({
80
81
"Your admin has not configured subdomain application access" ;
81
82
}
82
83
84
+ if ( app . subdomain_name && app . subdomain_name . length > 63 ) {
85
+ icon = (
86
+ < CircleAlertIcon
87
+ aria-hidden = "true"
88
+ className = "size-icon-sm text-content-warning"
89
+ />
90
+ ) ;
91
+ primaryTooltip = (
92
+ < >
93
+ Port forwarding will not work because hostname is too long, see the{ " " }
94
+ < Link
95
+ href = "https://coder.com/docs/user-guides/workspace-access/port-forwarding#dashboard"
96
+ target = "_blank"
97
+ size = "sm"
98
+ >
99
+ documentation
100
+ </ Link > { " " }
101
+ for more details
102
+ </ >
103
+ ) ;
104
+ }
105
+
83
106
if ( isExternalApp ( app ) && needsSessionToken ( app ) && ! link . hasToken ) {
84
107
canClick = false ;
85
108
}
0 commit comments