made the file index work on phones

This commit is contained in:
Nixietab 2026-08-23 08:08:23 -03:00
parent 581d3e6da5
commit 523e519a3b
3 changed files with 36 additions and 5 deletions

View file

@ -61,6 +61,7 @@ func (r row) ModS() string { return r.ModTime.Format("2006-01-02 15:04") }
type headerCol struct {
Label string
Class string
URL string
Active bool
Desc bool
@ -226,11 +227,18 @@ func (s *server) serveListing(w http.ResponseWriter, r *http.Request, dirPath, u
headers := []struct {
Label string
Key string
}{{"Name", "name"}, {"Type", "type"}, {"Size", "size"}, {"Modified", "modified"}}
Class string
}{
{"Name", "name", ""},
{"Type", "type", "ty"},
{"Size", "size", "sz"},
{"Modified", "modified", "mod"},
}
cols := make([]headerCol, len(headers))
for i, h := range headers {
cols[i] = headerCol{
Label: h.Label,
Class: h.Class,
Active: h.Key == sortKey,
Desc: h.Key == sortKey && desc,
}