58 lines
1.6 KiB
Go Template
58 lines
1.6 KiB
Go Template
{{$bucketName := .BucketName}}
|
|
{{$prefix := .Prefix }}
|
|
<!DOCTYPE html>
|
|
<head>
|
|
<style>
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
table, th, td {
|
|
border: 1px solid black;
|
|
}
|
|
th, td {
|
|
padding: 10px;
|
|
text-align: left;
|
|
}
|
|
th {
|
|
background-color: #f2f2f2;
|
|
}
|
|
</style>
|
|
</head>
|
|
<html lang="en">
|
|
<head><title>Index of {{$bucketName}}{{if $prefix}}/{{$prefix}}/{{end}}</title></head>
|
|
<body>
|
|
<h1>Index of {{$bucketName}}{{if $prefix}}/{{$prefix}}/{{end}}</h1>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Filename</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Created</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{if $prefix}}
|
|
<tr>
|
|
<td><a href="../">../</a></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
{{end}}
|
|
{{range .Objects}}
|
|
{{if .FileName}}
|
|
<tr>
|
|
<td>
|
|
<a href="/get/{{ $bucketName }}/{{if $prefix}}{{$prefix}}/{{end}}{{.FileName}}{{if not .Size}}/{{end}}?download=true">
|
|
{{.FileName}}{{if not .Size}}/{{end}}
|
|
</a>
|
|
</td>
|
|
<td>{{.Size}}</td>
|
|
<td>{{ formatDate .Created }}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|