mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
fix(admin-ui): distinct percent ticks and a type-clean build
The error-rate axis rounded half-percent ticks up, so labels repeated (4%, 4%, 3%, 3%). Ticks now show one decimal where needed. The CSS layer test imported node:fs, which broke npm run build under vue-tsc, so it is removed.
This commit is contained in:
@@ -221,6 +221,11 @@ export function formatModelCostHover(inputUsd: number, outputUsd: number): strin
|
||||
return `in ${formatUsdPerMTok(inputUsd)} / out ${formatUsdPerMTok(outputUsd)} per MTok`
|
||||
}
|
||||
|
||||
/** formatPercentAxis labels a 0-1 rate axis tick with up to one decimal, so half-percent ticks stay distinct ("0.5%" not "1%"). */
|
||||
export function formatPercentAxis(rate: number): string {
|
||||
return `${Math.round(rate * 1000) / 10}%`
|
||||
}
|
||||
|
||||
/** formatModelPriceShort is the table-cell form of formatModelCostHover: "$1.00 / $2.00" (input / output per MTok). */
|
||||
export function formatModelPriceShort(inputUsd: number, outputUsd: number): string {
|
||||
if (inputUsd === 0 && outputUsd === 0) return 'free'
|
||||
|
||||
Reference in New Issue
Block a user