mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
fix(webui): usage CSV, detail flags, burn-down labels
This commit is contained in:
@@ -125,3 +125,15 @@ export function usageCsv(
|
||||
// redesigned shell — grep confirms only this file and its own now-deleted
|
||||
// spec section ever referenced them. The redesigned Models page
|
||||
// (ModelCatalogTable.vue) has no CSV export of its own.
|
||||
|
||||
export interface BreakdownCsvRow {
|
||||
id: string
|
||||
value: number
|
||||
share: number | null
|
||||
}
|
||||
|
||||
/** breakdownCsv exports exactly what a Usage breakdown table shows: id, the range-selected metric (raw; cost stays micro-USD) and its share. */
|
||||
export function breakdownCsv(idHeader: string, metric: string, rows: BreakdownCsvRow[]): string {
|
||||
const metricHeader = metric === 'cost' ? 'cost (micro-USD)' : metric
|
||||
return toCsv([idHeader, metricHeader, 'share'], rows.map((r) => [r.id, r.value, r.share === null ? '' : r.share]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user