diff --git a/cmd/dashboard/controller/controller.go b/cmd/dashboard/controller/controller.go index 500a629..f655620 100644 --- a/cmd/dashboard/controller/controller.go +++ b/cmd/dashboard/controller/controller.go @@ -150,6 +150,9 @@ var funcMap = template.FuncMap{ }, "Transleft": func(a, b float64) (n float64) { n, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (100-(a/b)*100)), 64) + if n < 0 { + n = 0 + } return }, "UintToFloat": func(a uint64) (n float64) { diff --git a/resource/template/theme-default/service.html b/resource/template/theme-default/service.html index e0bdd3d..b7d03ce 100644 --- a/resource/template/theme-default/service.html +++ b/resource/template/theme-default/service.html @@ -69,7 +69,7 @@