- {workspace.latest_build.status === "running" && (
-
- )}
+ {workspace.latest_build.status === "running" &&
+ (workspace.latest_app_status ? (
+
+ ) : (
+
+ ))}
{abilities.actions.includes("start") && (
= ({ workspace }) => {
return buttons;
};
+type WorkspaceAppStatusLinksProps = {
+ workspace: Workspace;
+};
+
+const WorkspaceAppStatusLinks: FC = ({
+ workspace,
+}) => {
+ const status = workspace.latest_app_status;
+ const agent = workspace.latest_build.resources
+ .flatMap((r) => r.agents)
+ .find((a) => a?.id === status?.agent_id);
+ const app = agent?.apps.find((a) => a.id === status?.app_id);
+
+ return (
+ <>
+ {agent && app && (
+
+ )}
+
+ {status?.uri && status?.uri !== "n/a" && (
+
+ {status.uri.startsWith("file://") ? (
+
+ ) : (
+
+ )}
+
+ )}
+ >
+ );
+};
+
type IconAppLinkProps = {
app: WorkspaceApp;
workspace: Workspace;
@@ -730,6 +776,7 @@ type BaseIconLinkProps = PropsWithChildren<{
href: string;
isLoading?: boolean;
onClick?: (e: React.MouseEvent) => void;
+ target?: string;
}>;
const BaseIconLink: FC = ({
@@ -737,6 +784,7 @@ const BaseIconLink: FC = ({
isLoading,
label,
children,
+ target,
onClick,
}) => {
return (
@@ -745,6 +793,7 @@ const BaseIconLink: FC = ({