made the file index work on phones
This commit is contained in:
parent
581d3e6da5
commit
523e519a3b
3 changed files with 36 additions and 5 deletions
10
server.go
10
server.go
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue