feat(web): add custom file download button for runs output

This commit is contained in:
BennyKok
2023-12-20 23:14:01 +08:00
parent 8f67a136c3
commit ee68507755
10 changed files with 54 additions and 30 deletions
+1 -14
View File
@@ -1,3 +1,4 @@
import { RunInputs } from "@/components/RunInputs";
import { LiveStatus } from "./LiveStatus";
import { RunOutputs } from "@/components/RunOutputs";
@@ -51,17 +52,3 @@ export async function RunDisplay({
</Dialog>
);
}
export function OutputRender(props: { run_id: string; filename: string }) {
if (props.filename.endsWith(".png")) {
return (
<img
className="max-w-[200px]"
alt={props.filename}
src={`/api/view?file=${encodeURIComponent(
`outputs/runs/${props.run_id}/${props.filename}`
)}`}
/>
);
}
}