mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
feat(admin-ui): alias labels, active-provider legends, denser tables and readable money
Label configured model aliases with an alias badge wherever a model id shows. List only providers with traffic in the window in provider chart legends. Page long tables, show a scroll shadow on wide ones and drop the duplicate model link. Show costs with thousands separators and magnitude-scaled decimals on cards and chart axes. Use whole-number ticks for count charts and replace all-zero charts with a message. Back off polling after failures. Keep the CSV status region from widening the page on phones. Regenerate admin_assets_gen.go.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export interface PageWindow {
|
||||
/** Zero-based page index, clamped into range. */
|
||||
index: number
|
||||
count: number
|
||||
/** Zero-based start offset, inclusive. */
|
||||
from: number
|
||||
/** Zero-based end offset, exclusive. */
|
||||
to: number
|
||||
}
|
||||
|
||||
/** pageWindow clamps `index` into [0, count-1] and returns the row range for it (formal/Gateway/Ui/Paging.lean). */
|
||||
export function pageWindow(total: number, pageSize: number, index: number): PageWindow {
|
||||
const size = Math.max(1, Math.floor(pageSize))
|
||||
const count = Math.max(1, Math.ceil(total / size))
|
||||
const clamped = Math.min(Math.max(0, Math.floor(index)), count - 1)
|
||||
const from = clamped * size
|
||||
return { index: clamped, count, from, to: Math.min(total, from + size) }
|
||||
}
|
||||
Reference in New Issue
Block a user