feat(cliproxy): add provider editor with presets and control panel

- Add split-view provider editor with model mapping UI and JSON editor
- Implement persistent custom presets (save/load per provider)
- Add provider logos with white backgrounds for light/dark theme
- Integrate CLIProxyAPI control panel embed via iframe
- Add service manager for CLIProxyAPI lifecycle control
- Support variant logo display using parent provider
- Add categorized model selector with search and groups
This commit is contained in:
kaitranntt committed 2025-12-12 01:48:58 -05:00
1 parent f8648be6d9
commit 92b7065e10
26 files changed
+2712 -550

No files matched your search

+11 -4
View File
@@ -1,8 +1,14 @@
#!/usr/bin/env node
/**
* Verify UI bundle size is under 1MB gzipped
* React + shadcn/ui dashboard typically ranges 600-900KB
* Verify UI bundle size stays reasonable
*
* Current stack: React + TanStack Query + Radix UI + shadcn/ui + Recharts
* Expected range: 800KB - 1.5MB gzipped for full-featured dashboard
*
* This is a developer tool, not a public-facing site, so we optimize for
* features over minimal bundle size. The limit is a sanity check to catch
* accidental large dependencies, not a hard performance target.
*/
const fs = require('fs');
@@ -10,7 +16,7 @@ const path = require('path');
const zlib = require('zlib');
const UI_DIR = path.join(__dirname, '../dist/ui');
const MAX_SIZE = 1024 * 1024; // 1MB
const MAX_SIZE = 1.5 * 1024 * 1024; // 1.5MB - reasonable for full-featured React dashboard
function getGzipSize(filePath) {
const content = fs.readFileSync(filePath);
@@ -40,9 +46,10 @@ if (!fs.existsSync(UI_DIR)) {
const totalSize = walkDir(UI_DIR);
const sizeKB = (totalSize / 1024).toFixed(1);
const maxKB = (MAX_SIZE / 1024).toFixed(0);
if (totalSize > MAX_SIZE) {
console.log(`[X] Bundle too large: ${sizeKB}KB gzipped (max: 1024KB)`);
console.log(`[X] Bundle too large: ${sizeKB}KB gzipped (max: ${maxKB}KB)`);
process.exit(1);
} else {
console.log(`[OK] Bundle size: ${sizeKB}KB gzipped`);