feat: add timeUploaded to /tree

This commit is contained in:
jabuxas 2024-10-16 22:19:47 -03:00
parent 8ec85fdc1b
commit 8b0300c738
2 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func (app *Application) fileListingHandler(w http.ResponseWriter, r *http.Reques
Path: filepath.Join(r.URL.Path, file.Name()), Path: filepath.Join(r.URL.Path, file.Name()),
Size: info.Size(), Size: info.Size(),
FormattedSize: FormatFileSize(info.Size()), FormattedSize: FormatFileSize(info.Size()),
TimeUploaded: info.ModTime().
UTC().
Format("2006-01-02 15:04:05 UTC"),
}) })
} }

View File

@ -68,6 +68,7 @@
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Time Uploaded</th>
<th>Size</th> <th>Size</th>
</tr> </tr>
</thead> </thead>
@ -77,6 +78,7 @@
<td> <td>
<a href="{{.Path}}">{{.Name}}</a> <a href="{{.Path}}">{{.Name}}</a>
</td> </td>
<td>{{.TimeUploaded}}</td>
<td>{{.FormattedSize}}</td> <td>{{.FormattedSize}}</td>
</tr> </tr>
{{end}} {{end}}