diff --git a/internal/utils/numberutils/utils.go b/internal/utils/numberutils/utils.go index 18c55625..df16c20c 100644 --- a/internal/utils/numberutils/utils.go +++ b/internal/utils/numberutils/utils.go @@ -117,6 +117,16 @@ func TrimZeroSuffix(s string) string { } func formatDigit(d string) string { + if len(d) == 0 { + return d + } + + var prefix = "" + if d[0] < '0' || d[0] > '9' { + prefix = d[:1] + d = d[1:] + } + var l = len(d) if l > 3 { var pieces = l / 3 @@ -131,7 +141,7 @@ func formatDigit(d string) string { d2 += ", " } } - return d2 + return prefix + d2 } - return d + return prefix + d } diff --git a/internal/utils/numberutils/utils_test.go b/internal/utils/numberutils/utils_test.go index 53d00a0e..6065572a 100644 --- a/internal/utils/numberutils/utils_test.go +++ b/internal/utils/numberutils/utils_test.go @@ -45,6 +45,8 @@ func TestFormatFloat(t *testing.T) { t.Log(numberutils.FormatFloat(1234, 2)) t.Log(numberutils.FormatFloat(1234.00001, 4)) t.Log(numberutils.FormatFloat(1234.56700, 4)) + t.Log(numberutils.FormatFloat(-1234.56700, 2)) + t.Log(numberutils.FormatFloat(-221745.12, 2)) } func TestTrimZeroSuffix(t *testing.T) { diff --git a/web/views/@default/@layout.js b/web/views/@default/@layout.js index 6dcf59ab..ffd54c72 100644 --- a/web/views/@default/@layout.js +++ b/web/views/@default/@layout.js @@ -133,7 +133,7 @@ Tea.context(function () { this.showNodeTasks = function () { teaweb.popup("/clusters/tasks/listPopup", { height: "24em", - width: "50em" + width: "54em" }) } @@ -166,7 +166,7 @@ Tea.context(function () { this.showDNSTasks = function () { teaweb.popup("/dns/tasks/listPopup", { height: "24em", - width: "50em" + width: "54em" }) } }); diff --git a/web/views/@default/clusters/tasks/listPopup.html b/web/views/@default/clusters/tasks/listPopup.html index 4500b779..364312ff 100644 --- a/web/views/@default/clusters/tasks/listPopup.html +++ b/web/views/@default/clusters/tasks/listPopup.html @@ -27,11 +27,12 @@ {{task.node.name}}