feat(TrafficRoutes, App): implement interface speed test route and UI integration; update error handling for interface measurement
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m37s

This commit is contained in:
2026-02-17 22:41:02 +07:00
parent ab4ba37d53
commit d29f1aef51
4 changed files with 488 additions and 189 deletions
+9 -3
View File
@@ -235,9 +235,7 @@ async function measureInterfaceSpeed(req, res) {
String(i.name).trim() === String(interfaceName).trim()
);
if (!iface) {
throw new Error(
`Интерфейс "${interfaceName}" не найден на RouterOS (${serverId})`
);
return null;
}
const rx =
iface['rx-byte'] != null
@@ -253,9 +251,17 @@ async function measureInterfaceSpeed(req, res) {
};
}
const notFoundMessage = `Интерфейс "${interfaceName}" не найден на RouterOS (${serverId})`;
const start = await readOne();
if (!start) {
return sendError(res, 400, notFoundMessage, 'E_IFACE_NOT_FOUND');
}
await sleep(durationSeconds * 1000);
const end = await readOne();
if (!end) {
return sendError(res, 400, notFoundMessage, 'E_IFACE_NOT_FOUND');
}
const rxBytesDelta = Math.max(0, (end.rxBytes || 0) - (start.rxBytes || 0));
const txBytesDelta = Math.max(0, (end.txBytes || 0) - (start.txBytes || 0));