diff --git a/src/internal/mgr/group.go b/src/internal/mgr/group.go index d5c36cf..e0894b9 100644 --- a/src/internal/mgr/group.go +++ b/src/internal/mgr/group.go @@ -21,12 +21,12 @@ func UserGroupLabel(name string) string { } // MachineSpecs renders a compact quota tag for the container switcher: -// "cgg", e.g. "4c8g40g". CPU reuses FormatCPU (tenths of a +// "c g g", e.g. "4c 8g 40g". CPU reuses FormatCPU (tenths of a // core, so 0.5 stays fractional); memory is MiB rendered as GiB with a trimmed // decimal (1024 -> "1", 512 -> "0.5"); disk is already GiB. func MachineSpecs(cpuTenths, memMB, diskGB int) string { mem := strconv.FormatFloat(float64(memMB)/1024, 'f', -1, 64) - return FormatCPU(cpuTenths) + "c" + mem + "g" + strconv.Itoa(diskGB) + "g" + return FormatCPU(cpuTenths) + "c " + mem + "g " + strconv.Itoa(diskGB) + "g" } type UserGroup struct { diff --git a/src/internal/mgr/group_test.go b/src/internal/mgr/group_test.go index e187937..a3c3c9d 100644 --- a/src/internal/mgr/group_test.go +++ b/src/internal/mgr/group_test.go @@ -47,10 +47,10 @@ func TestMachineSpecs(t *testing.T) { cpu, mem, disk int want string }{ - {10, 1024, 10, "1c1g10g"}, - {40, 8192, 40, "4c8g40g"}, - {5, 512, 10, "0.5c0.5g10g"}, - {20, 1536, 20, "2c1.5g20g"}, + {10, 1024, 10, "1c 1g 10g"}, + {40, 8192, 40, "4c 8g 40g"}, + {5, 512, 10, "0.5c 0.5g 10g"}, + {20, 1536, 20, "2c 1.5g 20g"}, } { if got := MachineSpecs(test.cpu, test.mem, test.disk); got != test.want { t.Errorf("MachineSpecs(%d, %d, %d) = %q, want %q", test.cpu, test.mem, test.disk, got, test.want) diff --git a/src/internal/panel/panel.go b/src/internal/panel/panel.go index 7798946..780079a 100644 --- a/src/internal/panel/panel.go +++ b/src/internal/panel/panel.go @@ -133,7 +133,7 @@ type sshKeyRow struct { type groupMemberRow struct { Name string // account name, used as the ", ">" + child + ""} { if !strings.Contains(body, want) { t.Errorf("overview switcher missing %q", want) diff --git a/src/internal/panel/templates/overview.html b/src/internal/panel/templates/overview.html index 7bd8e0f..8732403 100644 --- a/src/internal/panel/templates/overview.html +++ b/src/internal/panel/templates/overview.html @@ -234,7 +234,7 @@ footer a{color:var(--muted);text-decoration:underline} {{if .Err}}
{{.Err}}
{{end}} {{if gt .GroupCount 1}} -
⚠ {{if eq .Lang "zh"}}您的用户组内有多台机器,当前机器序号为{{else}}Your user group has multiple containers. Current container number:{{end}} {{.GroupIndex}}。{{if eq .Lang "zh"}}请确认您操作的机器无误。{{else}}Confirm this is the intended container before operating.{{end}}{{if gt (len .GroupUsers) 1}}
{{end}}
+
⚠ {{if eq .Lang "zh"}}您的用户组内有多台机器,当前机器序号为{{else}}Your user group has multiple containers. Current container number:{{end}} {{.GroupIndex}}。{{if eq .Lang "zh"}}请确认您操作的机器无误。{{else}}Confirm this is the intended container before operating.{{end}}{{if gt (len .GroupUsers) 1}}
{{end}}
{{end}} {{if .Impersonated}}