@@ -18,7 +18,13 @@ import {
18
18
TableRow ,
19
19
Tooltip ,
20
20
} from "@mui/material" ;
21
- import { RestartAlt as RestartIcon } from "@mui/icons-material" ;
21
+ import {
22
+ RestartAlt as RestartIcon ,
23
+ Code as CodeIcon ,
24
+ GitHub as GitHubIcon ,
25
+ Archive as ArchiveIcon ,
26
+ Folder as FolderIcon ,
27
+ } from "@mui/icons-material" ;
22
28
23
29
import StatusChip from "./StatusChip" ;
24
30
@@ -49,6 +55,27 @@ function filterJobs(jobs, statusFilter, hardwareFilter, tagFilter) {
49
55
return filteredJobs ;
50
56
}
51
57
58
+ function formatCode ( code ) {
59
+ const style = { display : "inline-flex" , verticalAlign : "middle" , color : "lightgray" } ;
60
+ let icon = < CodeIcon sx = { style } /> ;
61
+ if ( code . includes ( "github" ) ) {
62
+ icon = < GitHubIcon sx = { style } /> ;
63
+ } else if ( code . startsWith ( "http" ) ) {
64
+ icon = < ArchiveIcon sx = { style } /> ;
65
+ } else if ( code . startsWith ( "collab:" ) ) {
66
+ icon = < FolderIcon sx = { style } /> ;
67
+ } else if ( code . startsWith ( "drive:" ) ) {
68
+ icon = < FolderIcon sx = { style } /> ;
69
+ }
70
+
71
+ return (
72
+ < span >
73
+ { icon }
74
+ < code > { code . trim ( ) . slice ( 0 , 60 ) . replaceAll ( "\n" , "⏎" ) } </ code >
75
+ </ span >
76
+ ) ;
77
+ }
78
+
52
79
function LinkedTableCell ( props ) {
53
80
return (
54
81
< TableCell align = { props . align } >
@@ -196,7 +223,7 @@ function JobList(props) {
196
223
{ job . hardware_platform }
197
224
</ LinkedTableCell >
198
225
< LinkedTableCell align = "left" to = { `/${ props . collab } /jobs/${ job . id } ` } >
199
- < code > { job . code . slice ( 0 , 60 ) } </ code >
226
+ { formatCode ( job . code ) }
200
227
</ LinkedTableCell >
201
228
< LinkedTableCell align = "left" to = { `/${ props . collab } /jobs/${ job . id } ` } >
202
229
{ timeFormat ( job . timestamp_submission ) }
0 commit comments