mirror of
https://github.com/mudler/LocalAI
synced 2026-05-24 09:28:23 +00:00
The merged feature (#9920) let admins see per-API-key and per-source totals but did not surface which user owned each key, and lumped every user's Web UI traffic into a single global Web UI row. This makes the admin Sources tab properly per-user attributable: - KeyTotal gains UserID + UserName, populated from the snapshot the usage middleware already records. The by_key roll-up now groups by (api_key_id, api_key_name, user_id, user_name). - New SourceTotals.ByUserSource roll-up groups (source, user_id, user_name) for sources without a key identity (web, legacy). Only populated on the admin path (includeLegacy=true); the non-admin endpoint stays unchanged for backwards compatibility. - SourcesTable accepts showUserColumn={isAdmin}; admin view renders a User column, makes the search match user name/id, and expands Web UI / legacy pseudo-rows from the global aggregate to one row per user using by_user_source. Refs: #9862 Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> |
||
|---|---|---|
| .. | ||
| apikeys.go | ||
| apikeys_test.go | ||
| auth_suite_test.go | ||
| branding_routes_test.go | ||
| db.go | ||
| db_nosqlite.go | ||
| db_sqlite.go | ||
| db_test.go | ||
| features.go | ||
| helpers_test.go | ||
| middleware.go | ||
| middleware_test.go | ||
| models.go | ||
| oauth.go | ||
| oauth_email_decision.go | ||
| oauth_email_decision_test.go | ||
| password.go | ||
| password_test.go | ||
| permissions.go | ||
| quota.go | ||
| roles.go | ||
| roles_test.go | ||
| session.go | ||
| session_test.go | ||
| usage.go | ||
| usage_test.go | ||
| users.go | ||
| users_test.go | ||