Fix some UI todos.
This commit is contained in:
parent
fb8fa5d935
commit
4bf5a1a0c4
@ -19,6 +19,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
@ -131,10 +132,6 @@ func getActiveCores(mask string) map[int]bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printCores(millicores *uint64) string {
|
func printCores(millicores *uint64) string {
|
||||||
// TODO(vmarmol): Detect this correctly
|
|
||||||
if *millicores > 1024*1000 {
|
|
||||||
return "unlimited"
|
|
||||||
}
|
|
||||||
cores := float64(*millicores) / 1000
|
cores := float64(*millicores) / 1000
|
||||||
return strconv.FormatFloat(cores, 'f', 3, 64)
|
return strconv.FormatFloat(cores, 'f', 3, 64)
|
||||||
}
|
}
|
||||||
@ -148,8 +145,7 @@ func toMegabytes(bytes uint64) float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printMegabytes(bytes uint64) string {
|
func printMegabytes(bytes uint64) string {
|
||||||
// TODO(vmarmol): Detect this correctly
|
if bytes >= math.MaxInt64 {
|
||||||
if bytes > (100 << 30) {
|
|
||||||
return "unlimited"
|
return "unlimited"
|
||||||
}
|
}
|
||||||
megabytes := toMegabytes(bytes)
|
megabytes := toMegabytes(bytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user