aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/server/filer_ui/templates.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/server/filer_ui/templates.go b/weed/server/filer_ui/templates.go
index e5ef4b8b6..e53d5caa7 100644
--- a/weed/server/filer_ui/templates.go
+++ b/weed/server/filer_ui/templates.go
@@ -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 }}
&nbsp;&nbsp;&nbsp;
{{end}}
</td>