You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
503 B

  1. package filer_ui
  2. import (
  3. _ "embed"
  4. "github.com/dustin/go-humanize"
  5. "html/template"
  6. "net/url"
  7. "strings"
  8. )
  9. func printpath(parts ...string) string {
  10. concat := strings.Join(parts, "")
  11. escaped := url.PathEscape(concat)
  12. return strings.ReplaceAll(escaped, "%2F", "/")
  13. }
  14. var funcMap = template.FuncMap{
  15. "humanizeBytes": humanize.Bytes,
  16. "printpath": printpath,
  17. }
  18. //go:embed filer.html
  19. var filerHtml string
  20. var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(filerHtml))