diff options
author | Antoni Sawicki <tenox@google.com> | 2022-03-24 01:07:14 -0700 |
---|---|---|
committer | Antoni Sawicki <tenox@google.com> | 2022-03-24 01:07:14 -0700 |
commit | af8f944cd6a504c011f6fee40597909d5d511e35 (patch) | |
tree | 966af656df45291d9c19b30f2c86dc717304ad4f | |
parent | f959058f7b6565e21d0a6d2ef80779bd4a06cfe6 (diff) | |
download | wfm-af8f944cd6a504c011f6fee40597909d5d511e35.tar.gz |
add total bytes line
-rw-r--r-- | TODO.md | 7 | ||||
-rw-r--r-- | dir.go | 6 |
2 files changed, 7 insertions, 6 deletions
@@ -1,6 +1,6 @@ # WFM TODO -## General +## Interfaces * webdav server * FastCGI Interface @@ -24,12 +24,10 @@ ## ACME / Auto Cert Manager * acme dir with key/cert is exposed inside chroot dir - obtain acme cert before chroot?? self call https? - get and preload cert manually on start? + get and preload cert manually on start before chroot? hide acm cache dir? * try https://github.com/go-acme/lego - ## Layout / UI * add flag to specify own favicon.ico * top bar too long on mobile/small screen @@ -41,7 +39,6 @@ * separate icons for different file types like images, docs, etc * errors in dialog boxes instead of plain text * html as template -* total bytes on the last line ## File IO * exclude/hide folders based on list @@ -27,6 +27,7 @@ func listFiles(w http.ResponseWriter, uDir, sort, hi, user string, modern bool) qeDir := url.QueryEscape(uDir) r := 0 + var total uint64 // List Directories First for _, f := range d { @@ -116,9 +117,12 @@ func listFiles(w http.ResponseWriter, uDir, sort, hi, user string, modern bool) </TD> </TR> `)) + total = total + uint64(f.Size()) } - w.Write([]byte(`</TABLE>`)) + // Footer + w.Write([]byte(`<TR><TD></TD><TD ALIGN="right" STYLE="border-top:1px solid grey">Total ` + + humanize.Bytes(total) + `</TD><TD></TD><TD></TD></TR></TABLE>`)) footer(w) } |