mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 07:14:04 +00:00
Adjusted the output for A and AAAA records
This commit is contained in:
parent
b2041cb36b
commit
44d9fa63f0
1 changed files with 10 additions and 3 deletions
|
@ -184,18 +184,25 @@ class Monitor extends BeanModel {
|
||||||
let dnsRes = await dnsResolve(this.hostname, this.dns_resolve_server, this.dns_resolve_type);
|
let dnsRes = await dnsResolve(this.hostname, this.dns_resolve_server, this.dns_resolve_type);
|
||||||
bean.ping = dayjs().valueOf() - startTime;
|
bean.ping = dayjs().valueOf() - startTime;
|
||||||
|
|
||||||
if (this.dns_resolve_type == "A" || this.dns_resolve_type == "AAAA" || this.dns_resolve_type == "CNAME" || this.dns_resolve_type == "PTR") {
|
if (this.dns_resolve_type == "A" || this.dns_resolve_type == "AAAA") {
|
||||||
|
dnsMessage += "Records: ";
|
||||||
|
dnsRes.forEach(record => {
|
||||||
|
dnsMessage += `${record} | `;
|
||||||
|
});
|
||||||
|
dnsMessage = dnsMessage.slice(0, -2)
|
||||||
|
} else if (this.dns_resolve_type == "CNAME" || this.dns_resolve_type == "PTR") {
|
||||||
dnsMessage = dnsRes[0];
|
dnsMessage = dnsRes[0];
|
||||||
} else if (this.dns_resolve_type == "CAA") {
|
} else if (this.dns_resolve_type == "CAA") {
|
||||||
dnsMessage = dnsRes[0].issue;
|
dnsMessage = dnsRes[0].issue;
|
||||||
} else if (this.dns_resolve_type == "MX") {
|
} else if (this.dns_resolve_type == "MX") {
|
||||||
dnsRes.forEach(record => {
|
dnsRes.forEach(record => {
|
||||||
dnsMessage += `Server: ${record.exchange} - Priority: ${record.priority} | `;
|
dnsMessage += `Hostname: ${record.exchange} - Priority: ${record.priority} | `;
|
||||||
});
|
});
|
||||||
dnsMessage = dnsMessage.slice(0, -2)
|
dnsMessage = dnsMessage.slice(0, -2)
|
||||||
} else if (this.dns_resolve_type == "NS") {
|
} else if (this.dns_resolve_type == "NS") {
|
||||||
|
dnsMessage += "Servers: ";
|
||||||
dnsRes.forEach(record => {
|
dnsRes.forEach(record => {
|
||||||
dnsMessage += `Server: ${record} | `;
|
dnsMessage += `${record} | `;
|
||||||
});
|
});
|
||||||
dnsMessage = dnsMessage.slice(0, -2)
|
dnsMessage = dnsMessage.slice(0, -2)
|
||||||
} else if (this.dns_resolve_type == "SOA") {
|
} else if (this.dns_resolve_type == "SOA") {
|
||||||
|
|
Loading…
Reference in a new issue