File tree Expand file tree Collapse file tree
packages/app/src/components/inference/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,9 +88,11 @@ const runLinkHTML = (runUrl?: string) =>
8888const tooltipLine = ( label : string , value : string | number ) =>
8989 `<div style="color: var(--muted-foreground); font-size: 11px; margin-bottom: 4px;"><strong>${ label } :</strong> ${ value } </div>` ;
9090
91+ const shortenSha = ( image : string ) => image . replaceAll ( / ( s h a 2 5 6 : [ a - f 0 - 9 ] { 7 } ) [ a - f 0 - 9 ] + / gi, '$1…' ) ;
92+
9193const imageTooltipLine = ( image : string ) =>
9294 `<div style="color: var(--muted-foreground); font-size: 11px; margin-bottom: 4px;">
93- <strong>Image:</strong> <span style="display: inline-block; vertical-align: top; overflow-wrap: anywhere;">${ image . trim ( ) . replace ( / \s + / , '<br />' ) } </span>
95+ <strong>Image:</strong> <span style="display: inline-block; vertical-align: top; overflow-wrap: anywhere;">${ shortenSha ( image . trim ( ) ) . replace ( / \s + / , '<br />' ) } </span>
9496 </div>` ;
9597
9698/**
You can’t perform that action at this time.
0 commit comments