mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-10-15 05:29:28 +00:00
feat(webui): MCP & Agents admin tab
New 'MCP & Agents' tab (after Charts) fed by GET /admin/api/targets: two Card panels, each a sortable DataTable (reusing DataTable/ SortHeaderButton — no hand-rolled table markup) listing configured MCP servers and agents with name, url (muted, truncated with a title tooltip), access (Badge per allowed group, muted 'All groups' when unrestricted — the same idiom UsageView's own group Access block already uses), and req/min, req/day, req/month. - types/api.ts: AdminTargetCountersView/AdminTargetView/ AdminTargetsResponse matching admin.go's JSON exactly. - stores/dashboard.ts: targets fetched in the SAME Promise.all/5s poll as overview and usage — one store, one timer, not a third. - lib/target-columns.ts: shared ColumnDef set both DataTables use. - components/TargetsView.vue: SearchInput + useSearchQuery name filter (inline matching, mirroring ProvidersView's own single-field aliasMatches — not every filter needs a lib/*-search.ts module).
This commit is contained in:
@@ -116,3 +116,31 @@ export interface UsageHistoryResponse {
|
||||
window: string
|
||||
points: UsageHistoryPoint[]
|
||||
}
|
||||
|
||||
/** One MCP-server or agent target's current-window request counters (admin.go: adminTargetCountersView) — requests only, no tokens or cost. */
|
||||
export interface AdminTargetCountersView {
|
||||
requestsPerMinute: number
|
||||
requestsPerDay: number
|
||||
requestsPerMonth: number
|
||||
}
|
||||
|
||||
/**
|
||||
* One configured MCP server's or A2A agent's row in GET /admin/api/targets
|
||||
* (admin.go: adminTargetView). Access is the group names actually allowed
|
||||
* to reach this target, computed server-side via the same matching authz
|
||||
* enforcement uses — undefined/empty means every configured group can
|
||||
* reach it ("empty meaning all", mirroring AdminUsageEntryView's own
|
||||
* providers/models/mcpServers/agents convention above).
|
||||
*/
|
||||
export interface AdminTargetView {
|
||||
name: string
|
||||
url: string
|
||||
access?: string[]
|
||||
counters: AdminTargetCountersView
|
||||
}
|
||||
|
||||
/** GET /admin/api/targets (admin.go: adminTargetsResponse). */
|
||||
export interface AdminTargetsResponse {
|
||||
mcpServers: AdminTargetView[]
|
||||
agents: AdminTargetView[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user