Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/runs/detail-tabs/Overview/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from "@zenml-io/react-component-library";
import { useEffect, useState } from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import { DeploymentTag } from "./deployment-tag";

type Props = {
runId: string;
Expand Down Expand Up @@ -57,6 +58,7 @@ export function Details({ runId }: Props) {
const executionMode = data.metadata?.config.execution_mode;

const sourceSnapshot = data.resources?.source_snapshot;
const deploymentId = data.metadata?.trigger_info?.deployment_id;
const schedule = data.resources?.schedule;

return (
Expand Down Expand Up @@ -128,6 +130,11 @@ export function Details({ runId }: Props) {
)
}
/>

<KeyValue
label="Deployment"
value={deploymentId ? <DeploymentTag deploymentId={deploymentId} /> : "Not available"}
/>
<Key>Execution Mode</Key>
<Value>{executionMode ? snakeCaseToTitleCase(executionMode) : "Not available"}</Value>
<Key>
Expand Down
25 changes: 25 additions & 0 deletions src/components/runs/detail-tabs/Overview/deployment-tag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { DeploymentStatusTag } from "@/components/deployments/deployment-status-tag";
import { deploymentQueries } from "@/data/deployments";
import { routes } from "@/router/routes";
import { useQuery } from "@tanstack/react-query";
import { Skeleton } from "@zenml-io/react-component-library";
import { Link } from "react-router-dom";

type Props = {
deploymentId: string;
};

export function DeploymentTag({ deploymentId }: Props) {
const deploymentQuery = useQuery(deploymentQueries.detail(deploymentId));

if (deploymentQuery.isPending) return <Skeleton className="h-6 w-[100px]" />;
if (deploymentQuery.isError) return "Not available";

const deployment = deploymentQuery.data;

return (
<Link to={routes.projects.deployments.detail.overview(deploymentId)}>
<DeploymentStatusTag size="sm" status={deployment.body?.status ?? undefined} />
</Link>
);
}
Loading