mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 00:00:50 +00:00
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>
18 lines
690 B
JavaScript
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)
|
|
})
|