Show downloaded files in workflow run (#1321)

This commit is contained in:
Shuchang Zheng
2024-12-04 12:39:58 -08:00
committed by GitHub
parent 04d3a56257
commit fc56299eac
2 changed files with 27 additions and 0 deletions

View File

@@ -206,6 +206,7 @@ export type WorkflowRunStatusApiResponse = {
recording_url: string | null; recording_url: string | null;
outputs: Record<string, unknown> | null; outputs: Record<string, unknown> | null;
failure_reason: string | null; failure_reason: string | null;
downloaded_file_urls: Array<string> | null;
}; };
export type TaskGenerationApiResponse = { export type TaskGenerationApiResponse = {

View File

@@ -49,6 +49,7 @@ import {
import { cn } from "@/util/utils"; import { cn } from "@/util/utils";
import { import {
CopyIcon, CopyIcon,
FileIcon,
Pencil2Icon, Pencil2Icon,
PlayIcon, PlayIcon,
ReaderIcon, ReaderIcon,
@@ -376,6 +377,8 @@ function WorkflowRun() {
</TableRow> </TableRow>
); );
const fileUrls = workflowRun?.downloaded_file_urls ?? [];
return ( return (
<div className="space-y-8"> <div className="space-y-8">
<header className="flex justify-between"> <header className="flex justify-between">
@@ -625,6 +628,29 @@ function WorkflowRun() {
/> />
</div> </div>
)} )}
{workflowRunIsFinalized && (
<div className="space-y-4">
<header>
<h2 className="text-lg font-semibold">Downloaded Files</h2>
</header>
<div className="space-y-2">
{fileUrls.length > 0 ? (
fileUrls.map((url) => {
return (
<div key={url} className="flex gap-2">
<FileIcon className="size-6" />
<a href={url} className="underline underline-offset-4">
<span>{url}</span>
</a>
</div>
);
})
) : (
<div>No files downloaded</div>
)}
</div>
</div>
)}
{Object.entries(parameters).length > 0 && ( {Object.entries(parameters).length > 0 && (
<div className="space-y-4"> <div className="space-y-4">
<header> <header>