@@ -10,7 +10,7 @@ <h2 class="title is-2">
10
10
< table class ="table is-striped " style ="width:100%; ">
11
11
< thead >
12
12
< tr >
13
- < th style ="width:40 %; "> Name</ th >
13
+ < th style ="width:30 %; "> Name</ th >
14
14
< th style ="width:10%; text-align:center; "> Size</ th >
15
15
< th style ="width:10%; text-align:center; "> Type</ th >
16
16
< th style ="width:20%; text-align:center; "> Uploaded</ th >
@@ -20,13 +20,35 @@ <h2 class="title is-2">
20
20
</ thead >
21
21
< tbody >
22
22
{{range .Data}}
23
- {{$fileType := convertFileType .Key}}
24
- < tr style ="height:100px; ">
23
+ {{$fileType := convertFileType .Key}}
24
+ {{$elementType := getElementByFileExt $fileType}}
25
+
26
+ {{ if or (eq $elementType "") (eq $elementType "audio")}}
27
+ < tr style ="height:100px; ">
28
+ {{ else }}
29
+ < tr style ="height:200px; ">
30
+ {{ end }}
25
31
< td > {{ parseFilename .Key }}</ td >
26
32
< td style ="text-align:center; "> {{ convertFileSize .Size }}</ td >
27
- < td style ="text-align:center; "> {{ convertFileType .Key }}</ td >
33
+ < td style ="text-align:center; "> {{ $fileType }}</ td >
28
34
< td style ="text-align:center; "> {{ convertFileUploadedDate .Uploaded}}</ td >
29
- < td style ="text-align:center; "> TODO</ td >
35
+ < td style ="text-align:center; ">
36
+ {{ if eq $elementType "image" }}
37
+ < a href ="{{ .URL }} ">
38
+ < img src ="{{ .URL }} " alt ="uploaded image " style ="height:200px; ">
39
+ </ a >
40
+ {{ else if eq $elementType "video" }}
41
+ < video controls style ="height:200px; ">
42
+ < source src ="{{ .URL }} ">
43
+ </ video >
44
+ {{ else if eq $elementType "audio" }}
45
+ < audio src ="{{ .URL }} " controls > </ audio >
46
+ {{ else }}
47
+ < a href ="{{ .URL }} ">
48
+ Can't preview!
49
+ </ a >
50
+ {{ end }}
51
+ </ td >
30
52
< td style ="text-align:center; ">
31
53
< a
32
54
href ="/ui/fs/del/{{ .ID }} "
0 commit comments