mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
Replace the 368-line hand-rolled SVG sparkline (with manual ResizeObserver, gradient/shadow/glow filters, grid + ticks + tooltip, custom Y-axis label thinning) with a thin Recharts `<AreaChart>` wrapper that keeps the same prop API. - Preserved props: data, labels, height, stroke, strokeWidth, maxPoints, showGrid, fillOpacity, showMarker, markerRadius, showAxes, yTickStep, tickCountX, showTooltip, valueMin, valueMax, yFormatter, tooltipFormatter. - Dropped: `vbWidth`, `gridColor`, `paddingLeft/Right/Top/Bottom` — Recharts' ResponsiveContainer handles width, and margins are wired to whether axes are visible. Removed the unused `vbWidth` prop from SystemHistoryModal, XrayMetricsModal, NodeHistoryPanel callsites. - Tooltip, grid, and axis text now use AntD CSS variables for automatic light/dark adaptation; replaced the SVG body.dark forks in Sparkline.css with a single 5-line stylesheet. - Bundle: vendor +~100KB gzip (Recharts + its d3 deps), trade-off for less custom chart code to maintain and a more standard API for future charts (multi-series, brush, etc.).
53 lines
1.4 KiB
JSON
53 lines
1.4 KiB
JSON
{
|
|
"name": "3x-ui-frontend",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"description": "3x-ui panel frontend (React 19 + Ant Design 6 + Vite 8).",
|
|
"engines": {
|
|
"node": ">=22.0.0",
|
|
"npm": ">=10.0.0"
|
|
},
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "npm run gen:api && vite build",
|
|
"preview": "vite preview",
|
|
"lint": "eslint src",
|
|
"typecheck": "tsc --noEmit",
|
|
"gen:api": "node scripts/build-openapi.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@ant-design/icons": "^6.2.3",
|
|
"@codemirror/lang-json": "^6.0.2",
|
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
"@tanstack/react-query": "^5.100.14",
|
|
"@tanstack/react-query-devtools": "^5.100.14",
|
|
"antd": "^6.4.3",
|
|
"axios": "^1.16.1",
|
|
"codemirror": "^6.0.2",
|
|
"dayjs": "^1.11.20",
|
|
"i18next": "^26.2.0",
|
|
"otpauth": "^9.5.1",
|
|
"persian-calendar-suite": "^1.5.5",
|
|
"qs": "^6.15.2",
|
|
"react": "^19.2.6",
|
|
"react-dom": "^19.2.6",
|
|
"react-i18next": "^17.0.8",
|
|
"react-router-dom": "^7.15.1",
|
|
"recharts": "^3.8.1",
|
|
"swagger-ui-react": "^5.32.6"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@types/react": "^19.2.15",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@types/swagger-ui-react": "^5.18.0",
|
|
"@vitejs/plugin-react": "^6.0.2",
|
|
"eslint": "^10.4.0",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"globals": "^17.6.0",
|
|
"typescript": "^6.0.3",
|
|
"typescript-eslint": "^8.59.4",
|
|
"vite": "8.0.13"
|
|
}
|
|
}
|