From 475c6a3eeb746d800c68d80f1c33ec91763596d9 Mon Sep 17 00:00:00 2001 From: Siggi Simonarson Date: Thu, 19 Dec 2024 13:56:03 -0800 Subject: [PATCH 1/2] Add symlinks to files tab --- app/invocation/invocation_file_card.tsx | 104 +++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/app/invocation/invocation_file_card.tsx b/app/invocation/invocation_file_card.tsx index 4897e79d19f..7983087285a 100644 --- a/app/invocation/invocation_file_card.tsx +++ b/app/invocation/invocation_file_card.tsx @@ -8,7 +8,7 @@ import { tools } from "../../proto/spawn_ts_proto"; import format from "../format/format"; import error_service from "../errors/error_service"; import * as varint from "varint"; -import { Download, FileIcon, Folder, FolderOpen } from "lucide-react"; +import { Download, FileIcon, FileSymlink, Folder, FolderOpen } from "lucide-react"; import DigestComponent from "../components/digest/digest"; import Link from "../components/link/link"; import Long from "long"; @@ -25,6 +25,7 @@ interface State { direction: "asc" | "desc"; fileLimit: number; directoryLimit: number; + symlinkLimit: number; log: tools.protos.ExecLogEntry[] | undefined; directoryToFileLimit: Map; } @@ -37,6 +38,7 @@ export default class InvocationFileCardComponent extends React.Component(), }; @@ -141,6 +143,13 @@ export default class InvocationFileCardComponent extends React.Component | undefined) { return ( (files || []).map((f) => f.digest?.sizeBytes || 0).reduce((a, b) => new Long(+a + +b), Long.ZERO) || Long.ZERO @@ -189,6 +198,14 @@ export default class InvocationFileCardComponent extends React.Component { + if (l.type != "unresolvedSymlink") { + return false; + } + if ( + this.props.filter != "" && + !l.unresolvedSymlink?.path.toLowerCase().includes(this.props.filter.toLowerCase()) && + !l.unresolvedSymlink?.targetPath.toLowerCase().includes(this.props.filter.toLowerCase()) + ) { + return false; + } + + return true; + }) + .sort(this.compareSymlinks.bind(this)); + return (
@@ -457,6 +491,74 @@ export default class InvocationFileCardComponent extends React.Component
+
+
+
+
+ Symlinks ({format.formatWithCommas(symlinks.length)}){" "} + this.downloadLog()} /> +
+
+ Sort by + + +
+ + +
+
+ + +
+
+
+
+
+
+ {symlinks.slice(0, this.state.symlinkLimit).map((entry) => { + return ( +
+
+ {" "} +
+
+
+
{entry.unresolvedSymlink?.path}
+
+
+ {entry.unresolvedSymlink?.targetPath} +
+
+
+ ); + })} +
+ {symlinks.length > this.state.symlinkLimit && ( +
+ See more symlinks + See all symlinks +
+ )} +
+
+
); } From 2724dd81daad969e6080c2e396c73529a7bb9260 Mon Sep 17 00:00:00 2001 From: Siggi Simonarson Date: Thu, 19 Dec 2024 17:12:56 -0800 Subject: [PATCH 2/2] Add some CSS I forgot in the other PR --- app/invocation/invocation.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/invocation/invocation.css b/app/invocation/invocation.css index 414812b29f9..26817862a70 100644 --- a/app/invocation/invocation.css +++ b/app/invocation/invocation.css @@ -854,6 +854,10 @@ padding: 16px 0; } +.invocation-execution-row.nested { + padding-left: 32px; +} + .invocation-execution-row:last-child { border-bottom: 1px solid #eee; } @@ -1232,6 +1236,12 @@ svg.invocation-query-graph .nodes rect { margin-right: 16px; } +.invocation .more-buttons.nested { + margin-top: 0; + margin-bottom: 32px; + margin-left: 32px; +} + .workflow-details-header { margin-top: 32px; margin-bottom: 16px;