mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
feat(webui): users page
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user