The two per-client usage charts exposed different time windows: "Wireless Usage" offered 2h/24h/7d while "App Traffic (NetFlow)" offered 1h/24h/7d/30d. Worse, selecting 1h (or any range with no flows in window) made the whole App Traffic card unmount — including its range buttons, so it couldn't be recovered without reloading. - AppTrafficCard now uses 2h/24h/7d (default 24h), matching Wireless Usage - Card visibility latches on first non-empty result, so switching to an empty range shows an inline "No traffic data yet for this range" state instead of unmounting the card (latch derived via guarded setState in render — no effect) - Backend /api/traffic/* now accepts the '2h' range (rangeToFlux + windowForRange: 2h -> 2m buckets); previously '2h' silently fell back to 24h Verified in the live stack with Playwright: ranges render as 2h/24h/7d (no 1h/30d), and clicking 2h on a client with data only outside the 2h window keeps the card mounted with an empty-state and recovers on switching back. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
63 lines
1.7 KiB
JSON
63 lines
1.7 KiB
JSON
{
|
|
"name": "mikrotik-manager-backend",
|
|
"version": "0.13.2-beta",
|
|
"description": "Mikrotik Network Management Platform - Backend API",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"dev": "nodemon --watch src --ext ts --exec ts-node src/index.ts",
|
|
"lint": "eslint src",
|
|
"migrate": "ts-node src/db/migrate.ts",
|
|
"test": "jest",
|
|
"test:coverage": "jest --coverage"
|
|
},
|
|
"dependencies": {
|
|
"@influxdata/influxdb-client": "^1.33.2",
|
|
"@influxdata/influxdb-client-apis": "^1.35.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"bullmq": "^5.1.1",
|
|
"compression": "^1.7.4",
|
|
"cors": "^2.8.5",
|
|
"dotenv": "^17.4.2",
|
|
"express": "^4.18.2",
|
|
"express-async-errors": "^3.1.1",
|
|
"helmet": "^8.1.0",
|
|
"ioredis": "^5.3.2",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"morgan": "^1.10.0",
|
|
"nodemailer": "^8.0.5",
|
|
"otpauth": "^9.5.1",
|
|
"pg": "^8.11.3",
|
|
"qrcode": "^1.5.4",
|
|
"socket.io": "^4.6.1",
|
|
"ssh2": "^1.14.0",
|
|
"zod": "^3.22.4"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.4",
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/compression": "^1.7.5",
|
|
"@types/cors": "^2.8.17",
|
|
"@types/express": "^4.17.21",
|
|
"@types/jest": "^30.0.0",
|
|
"@types/jsonwebtoken": "^9.0.5",
|
|
"@types/morgan": "^1.9.9",
|
|
"@types/node": "^20.10.5",
|
|
"@types/nodemailer": "^6.4.14",
|
|
"@types/pg": "^8.10.9",
|
|
"@types/qrcode": "^1.5.6",
|
|
"@types/ssh2": "^1.11.17",
|
|
"@types/supertest": "^7.2.0",
|
|
"eslint": "^9.39.4",
|
|
"eslint-plugin-security": "^4.0.0",
|
|
"jest": "^30.4.2",
|
|
"nodemon": "^3.0.2",
|
|
"supertest": "^7.2.2",
|
|
"ts-jest": "^29.4.9",
|
|
"ts-node": "^10.9.2",
|
|
"typescript": "^5.3.3",
|
|
"typescript-eslint": "^8.58.2"
|
|
}
|
|
}
|