feat(MikrotikTools): add configurable DNS usage option in traceroute for flexible user preferences
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 2m23s
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 2m23s
This commit is contained in:
@@ -558,6 +558,7 @@ async function tracerouteViaGateway(req, res) {
|
|||||||
target,
|
target,
|
||||||
gatewayIp,
|
gatewayIp,
|
||||||
maxHops = 30,
|
maxHops = 30,
|
||||||
|
useDns = true,
|
||||||
} = req.body || {};
|
} = req.body || {};
|
||||||
|
|
||||||
if (!serverId) {
|
if (!serverId) {
|
||||||
@@ -705,8 +706,8 @@ async function tracerouteViaGateway(req, res) {
|
|||||||
if (!Number.isFinite(countNum) || countNum <= 0) countNum = 1;
|
if (!Number.isFinite(countNum) || countNum <= 0) countNum = 1;
|
||||||
body.count = countNum;
|
body.count = countNum;
|
||||||
|
|
||||||
// Включаем reverse DNS (как use-dns=yes), чтобы видеть имена
|
// Включаем/отключаем reverse DNS (как use-dns=yes/no)
|
||||||
body['use-dns'] = 'yes';
|
body['use-dns'] = useDns ? 'yes' : 'no';
|
||||||
|
|
||||||
const hopsNum = Number(maxHops);
|
const hopsNum = Number(maxHops);
|
||||||
if (Number.isFinite(hopsNum) && hopsNum > 0) {
|
if (Number.isFinite(hopsNum) && hopsNum > 0) {
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ function MikrotikTools() {
|
|||||||
const body = {
|
const body = {
|
||||||
serverId,
|
serverId,
|
||||||
target: String(target).trim(),
|
target: String(target).trim(),
|
||||||
|
useDns,
|
||||||
};
|
};
|
||||||
// gatewayRef может быть как ID gateway, так и IP/строка —
|
// gatewayRef может быть как ID gateway, так и IP/строка —
|
||||||
// для простоты, если в meta есть ip — используем его как gatewayIp.
|
// для простоты, если в meta есть ip — используем его как gatewayIp.
|
||||||
|
|||||||
Reference in New Issue
Block a user