litellm/ui/litellm-dashboard
Yuneng Jiang 770a4feb8d
refactor(ui): extract the MCP server edit payload into a pure module
`handleSave` was 280 lines that parsed stdio JSON, filtered credentials,
resolved half a dozen conditional flags, built the request body, and then made
the network call, all inside one try block reading ten closure variables. None
of it could be tested without rendering the whole modal and pressing Save.

The payload building moves to `editServerPayload.ts` as `buildEditServerPayload`,
mirroring the `createServerPayload.ts` module that already sits beside it: a
pure function taking form values, UI state, and the server being edited, and
returning a tagged union rather than throwing. The six ways it can fail are now
values in that union, and the component maps them to the same toasts it showed
before via an exhaustive switch, so no message text changes.

`AUTH_TYPES_REQUIRING_CREDENTIALS` and the static-header reducer were duplicated
between the create and edit paths; the extracted module imports the create
module's copies instead. The credential filter and stdio parser stay separate,
because the edit versions genuinely differ: edit writes an explicit null to
clear a blanked admin-config key, and stringifies stdio args and env values
where create passes them through

Behaviour is unchanged, and the payload net added earlier is what proves it:
all 20 of its cases still pass against the extracted builder without any
edit to their expectations.

40 unit tests cover the new module in single-digit milliseconds, reaching the
rejection paths and parsing branches that were previously only reachable
through a full render. A ten-mutant battery kills 10/10, each mutant taking
down exactly one test, which is the profile worth having: the tests are
targeted rather than broadly overlapping

One of those mutants is worth noting. Removing the access-group name
normalisation survives the integration net but dies here, because the antd
Select hands the form plain strings and the unit test does not. That mapping is
dead only while that control stays; it is covered now either way
2026-08-18 22:06:44 -07:00
..
public feat(vector_stores): add Valkey as a managed vector store provider (#37002) 2026-08-18 21:45:22 +00:00
scripts test(ui): query antd controls accessibly instead of by internal CSS class 2026-08-15 01:41:24 -07:00
src refactor(ui): extract the MCP server edit payload into a pure module 2026-08-18 22:06:44 -07:00
tests refactor(ui): drop @tremor/react and the theming scaffolding it needed (#37394) 2026-08-18 17:38:12 -07:00
.env.development hidden dashboard routing, dev and build env files 2025-10-06 19:21:34 -07:00
.env.production remove next env 2026-04-18 16:45:32 -07:00
.npmrc chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
.nvmrc chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
.prettierignore feat(ui): generate dashboard API types from the proxy OpenAPI spec (#29816) 2026-06-05 17:20:01 -07:00
.prettierrc added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
build_release_ui.sh build release ui script 2026-01-17 18:16:14 -08:00
build_ui.sh chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
build_ui_custom_path.sh chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
CLAUDE.md refactor(ui): move the model info view and pass-through endpoint forms off tremor (#37308) 2026-08-18 23:19:23 +00:00
components.json refactor(ui): switch shadcn primitives from Radix to Base UI (#32124) 2026-07-07 09:55:41 -07:00
eslint-budgets.json chore: make no-console max 12 2026-08-05 10:45:56 -07:00
eslint-suppressions.json refactor(ui): migrate the key edit form off Ant Design onto react-hook-form (#37398) 2026-08-18 19:40:37 -07:00
eslint.config.mjs build(ui): gate dashboard test assertions with testing-library and jest-dom 2026-08-17 14:46:55 -07:00
knip.json fix(ui): register type-test files as knip entry points 2026-08-10 15:42:09 -07:00
next.config.mjs chore(ui): preserve console.warn in prod builds to match lint allow-list 2026-07-03 14:51:14 -07:00
package-lock.json refactor(ui): drop @tremor/react and the theming scaffolding it needed (#37394) 2026-08-18 17:38:12 -07:00
package.json refactor(ui): drop @tremor/react and the theming scaffolding it needed (#37394) 2026-08-18 17:38:12 -07:00
postcss.config.js feat(ui): shadcn migration foundation: Tailwind v4, shadcn init, antd cascade fix (#31995) 2026-07-02 19:02:27 -07:00
README.md build(ui/litellm-dashboard): initial commit of litellm dashboard 2024-01-27 12:12:48 -08:00
tsconfig.json test(e2e): move Admin UI Playwright suite to tests/e2e/ui (#34196) 2026-07-22 19:43:10 +00:00
tsconfig.tsbuildinfo feat(shadow-eval): name the shadowed key in job responses and the UI headline (#37221) 2026-08-17 22:12:59 +00:00
vitest.config.ts test(ui): raise vitest test and hook timeouts for CI headroom (#37370) 2026-08-18 22:41:16 +00:00

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.