From 118a971448fcb8a6e0d6b9d550676fda05c37f52 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 24 Dec 2018 11:39:27 -0500 Subject: [PATCH] Fix some query types in fake data getting shown as "ERROR" The ERROR query type is not necessary, and the issue with fake data generating the wrong query types is fixed. Signed-off-by: Mcat12 --- make-fake-data.js | 8 ++++---- src/components/log/QueryLog.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/make-fake-data.js b/make-fake-data.js index 9bf82e5..f6e56d4 100644 --- a/make-fake-data.js +++ b/make-fake-data.js @@ -50,16 +50,16 @@ function history(length) { return { timestamp: startDate + i, - type: isIPv4 ? 0 : 1, - status: Math.floor(Math.random() * 6) + 1, + type: isIPv4 ? 1 : 2, + status: Math.floor(Math.random() * 6), domain: faker.internet.domainName(), client: isHostname ? faker.internet.domainWord() + ".local" : isIPv4 ? faker.internet.ip() : faker.internet.ipv6(), - dnssec: Math.floor(Math.random() * 5) + 1, - reply: Math.floor(Math.random() * 6) + 1, + dnssec: Math.floor(Math.random() * 5), + reply: Math.floor(Math.random() * 7), response_time: Math.floor(Math.random() * 100) }; }) diff --git a/src/components/log/QueryLog.js b/src/components/log/QueryLog.js index 0a28597..b08a499 100644 --- a/src/components/log/QueryLog.js +++ b/src/components/log/QueryLog.js @@ -170,7 +170,7 @@ const replyTypes = t => [ /** * Convert a query type code to a query type. */ -const queryTypes = ["ERROR", "A", "AAAA", "ANY", "SRV", "SOA", "PTR", "TXT"]; +const queryTypes = ["A", "AAAA", "ANY", "SRV", "SOA", "PTR", "TXT"]; /** * The columns of the Query Log. Some pieces are translated, so you must pass in @@ -204,7 +204,7 @@ const columns = t => [ { Header: t("Type"), id: "type", - accessor: r => queryTypes[r.type], + accessor: r => queryTypes[r.type - 1], width: 50 }, {