Merge pull request #124 from pi-hole/fix/history-fake-query-type

Fix some query types in fake data getting shown as "ERROR"
This commit is contained in:
Mark Drobnak
2018-12-24 11:41:10 -05:00
committed by GitHub
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -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)
};
})
+2 -2
View File
@@ -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
},
{