mirror of
https://git.sync.wtf/troed/oc-ls-stats.git
synced 2026-08-31 09:43:38 +03:00
fix: v0.0.55 - use pad3 for percentage display
- Percentages max at 3 chars (100), pad4 gives one too many dashes
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@troed/oc-ls-stats",
|
||||
"version": "0.0.54",
|
||||
"version": "0.0.55",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./tui": {
|
||||
|
||||
@@ -206,6 +206,11 @@ function pad4(s: string | undefined) {
|
||||
return s.padStart(4, " ")
|
||||
}
|
||||
|
||||
function pad3(s: string | undefined) {
|
||||
if (!s) return "---"
|
||||
return s.padStart(3, " ")
|
||||
}
|
||||
|
||||
function activeDurationMs(samples: StreamSample[], tailAt?: number) {
|
||||
if (samples.length === 0) return 0
|
||||
if (samples.length === 1) {
|
||||
@@ -261,7 +266,7 @@ function SessionPromptRight(props: {
|
||||
const pp = prefillRate()
|
||||
const tps = liveTps()
|
||||
const progress = prefillProgress()
|
||||
const ppLabel = pp ? `PP ${pad4(formatPps(pp))} tps (${pad4(formatPercent(progress))}%)` : `PP ${pad4(undefined)} tps (${pad4(undefined)}%)`
|
||||
const ppLabel = pp ? `PP ${pad4(formatPps(pp))} tps (${pad3(formatPercent(progress))}%)` : `PP ${pad4(undefined)} tps (${pad3(undefined)}%)`
|
||||
const tpsLabel = tps ? `GEN ${pad4(formatTps(tps))} tps` : `GEN ${pad4(undefined)} tps`
|
||||
return `${ppLabel} | ${tpsLabel}`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user