mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 00:00:50 +00:00
feat: React admin UI migration — React 19 + TypeScript + Traffic/Uptime tabs
Replace 1,928-line monolithic vanilla JS admin SPA with React 19 + TypeScript 5 application. Adds Traffic and Uptime tabs backed by new Rust API endpoints. - Vite + vite-plugin-singlefile: single dist/index.html with inlined JS/CSS - Custom closeBundle plugin preserves __CSP_NONCE__ placeholder for Rust injection - React Query v5 for server state, Zustand v5 for auth + WS connection state - All existing backend contracts preserved (CSRF, WS auth, sessionStorage key) - New: GET /admin/api/traffic (route load, P95, req/min, time series) - New: GET /admin/api/uptime (proxy start time, per-backend 30d history) - New: health_checks SQLite table + background Tokio health-checker (30s probe) - BackendHealthChanged WS event for immediate Uptime tab refresh on status flip - Dockerfile gains Node.js Stage 1 for frontend build - CI gains frontend job (tsc + lint + build) before Rust test job Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,10 +11,43 @@ env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
test:
|
||||
frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: crates/proxy/admin-ui/package-lock.json
|
||||
- name: Install dependencies
|
||||
working-directory: crates/proxy/admin-ui
|
||||
run: npm ci
|
||||
- name: TypeScript check
|
||||
working-directory: crates/proxy/admin-ui
|
||||
run: npx tsc --noEmit
|
||||
- name: Lint
|
||||
working-directory: crates/proxy/admin-ui
|
||||
run: npm run lint
|
||||
- name: Build
|
||||
working-directory: crates/proxy/admin-ui
|
||||
run: npm run build
|
||||
- name: Upload dist
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: admin-ui-dist
|
||||
path: crates/proxy/admin-ui/dist/
|
||||
|
||||
test:
|
||||
needs: frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download dist
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: admin-ui-dist
|
||||
path: crates/proxy/admin-ui/dist/
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy, rustfmt
|
||||
@@ -63,6 +96,11 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download dist
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: admin-ui-dist
|
||||
path: crates/proxy/admin-ui/dist/
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
Reference in New Issue
Block a user