feat(webui): users page

This commit is contained in:
2026-11-25 11:52:36 +00:00
parent 713a8acb09
commit abdc059ed3
10 changed files with 760 additions and 10 deletions
@@ -21,6 +21,9 @@ import type { LimitKey, LimitsConfig } from '@/types/api'
const props = defineProps<{
groupNames: string[]
userNames: string[]
/** Pre-selects the target (a detail panel opens the form for its own entity). */
presetKind?: 'group' | 'user'
presetName?: string
}>()
const { targetKind, targetName, targetNames, nameValid, snippetLabel } = useTargetPicker(
@@ -28,6 +31,11 @@ const { targetKind, targetName, targetNames, nameValid, snippetLabel } = useTarg
() => props.userNames,
)
if (props.presetName) {
targetKind.value = props.presetKind ?? 'user'
targetName.value = props.presetName
}
/** INTEGER_FIELDS is every LimitsConfig field Go decodes as `int64` (llmgateway.go) — requestsPerMinute/requestsPerDay/tokensPerDay/tokensPerMonth reject a fractional value like "1.5" at json.Unmarshal outright (P2 item 12), unlike costPerDayUSD/costPerMonthUSD, which are `float64`. */
const INTEGER_FIELDS = new Set<LimitKey>(['requestsPerMinute', 'requestsPerDay', 'tokensPerMinute', 'tokensPerDay', 'tokensPerMonth'])