Files
anyllm-proxy/crates/proxy/admin-ui/vite.config.test.mjs
whit3rabbitandClaude Opus 4.8 65cf673b97 feat: performative admin UI redesign + admin API contract fixes
Large admin-ui refactor (Performative component system, sidebar nav,
provider/route tabs) plus backend module restructuring.

Admin UI contract fixes (this session):
- Fix Models page crash: useBackends unwraps {backends:[...]}; align
  ModelEntry to {model_name, deployments} and ModelsResponse.strategy;
  fix add-model body to {model_name, actual_model, backend_name}.
- Fix Backends/Providers health rendering: source per-backend status and
  latency from the uptime endpoint (health_checks); narrow Backend type to
  the real get_backends shape.
- Route + sidebar-link the previously-unrouted Backends tab.

Verified: cargo test (exit 0), clippy -D warnings (exit 0), fmt --check,
admin-ui tsc + vite build all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:13:59 -05:00

18 lines
690 B
JavaScript

import assert from 'node:assert/strict'
import test from 'node:test'
import { resolveConfig } from 'vite'
test('dev server proxies admin API routes to the Rust admin server', async () => {
process.env.ADMIN_PORT = '3141'
delete process.env.ANYLLM_ADMIN_PROXY_TARGET
const config = await resolveConfig({}, 'serve', 'development')
const proxy = config.server.proxy ?? {}
assert.ok(proxy['/admin/api'], 'missing /admin/api proxy')
assert.ok(proxy['/admin/csrf-token'], 'missing /admin/csrf-token proxy')
assert.ok(proxy['/admin/ws'], 'missing /admin/ws proxy')
assert.equal(proxy['/admin/api'].target, 'http://127.0.0.1:3141')
assert.equal(proxy['/admin/ws'].ws, true)
})