mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
readable file size
This commit is contained in:
parent
2e427c66ac
commit
b931ced0a3
|
@ -2,9 +2,14 @@ package master_ui
|
|||
|
||||
import (
|
||||
"html/template"
|
||||
"github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
|
||||
var funcMap = template.FuncMap{
|
||||
"humanizeBytes": humanize.Bytes,
|
||||
}
|
||||
|
||||
var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SeaweedFS Filer</title>
|
||||
|
@ -54,7 +59,7 @@ var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
|
|||
<td align="right">
|
||||
{{if $entry.IsDirectory}}
|
||||
{{else}}
|
||||
{{ $entry.Size }} bytes
|
||||
{{ $entry.Size | humanizeBytes }}
|
||||
|
||||
{{end}}
|
||||
</td>
|
||||
|
|
Loading…
Reference in a new issue