diff --git a/server/model/monitor.js b/server/model/monitor.js index 4fa8e2979..bdfa59555 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -184,28 +184,28 @@ class Monitor extends BeanModel { let dnsRes = await dnsResolve(this.hostname, this.dns_resolve_server, this.dns_resolve_type); 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" || this.dns_resolve_type == "CNAME" || this.dns_resolve_type == "PTR") { dnsMessage = dnsRes[0]; - } else if (this.dns_resolve_type == 'CAA') { + } else if (this.dns_resolve_type == "CAA") { dnsMessage = dnsRes[0].issue; - } else if (this.dns_resolve_type == 'MX') { + } else if (this.dns_resolve_type == "MX") { dnsRes.forEach(record => { dnsMessage += `Server: ${record.exchange} - Priority: ${record.priority} | `; }); dnsMessage = dnsMessage.slice(0, -2) - } else if (this.dns_resolve_type == 'NS') { + } else if (this.dns_resolve_type == "NS") { dnsRes.forEach(record => { dnsMessage += `Server: ${record} | `; }); dnsMessage = dnsMessage.slice(0, -2) - } else if (this.dns_resolve_type == 'SOA') { + } else if (this.dns_resolve_type == "SOA") { dnsMessage += `NS-Name: ${dnsRes.nsname} | Hostmaster: ${dnsRes.hostmaster} | Serial: ${dnsRes.serial} | Refresh: ${dnsRes.refresh} | Retry: ${dnsRes.retry} | Expire: ${dnsRes.expire} | MinTTL: ${dnsRes.minttl}`; - } else if (this.dns_resolve_type == 'SRV') { + } else if (this.dns_resolve_type == "SRV") { dnsRes.forEach(record => { dnsMessage += `Name: ${record.name} | Port: ${record.port} | Priority: ${record.priority} | Weight: ${record.weight} | `; }); dnsMessage = dnsMessage.slice(0, -2) - } else if (this.dns_resolve_type == 'TXT') { + } else if (this.dns_resolve_type == "TXT") { dnsRes.forEach(record => { dnsMessage += `Record: ${record} | `; }); diff --git a/server/util-server.js b/server/util-server.js index 2628a4fe5..a30bcfec0 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -4,7 +4,7 @@ const { R } = require("redbean-node"); const { debug } = require("../src/util"); const passwordHash = require("./password-hash"); const dayjs = require("dayjs"); -const { Resolver } = require('dns'); +const { Resolver } = require("dns"); /** * Init or reset JWT secret @@ -81,7 +81,7 @@ exports.dnsResolve = function (hostname, resolver_server, rrtype) { const resolver = new Resolver(); resolver.setServers([resolver_server]); return new Promise((resolve, reject) => { - if (rrtype == 'PTR') { + if (rrtype == "PTR") { resolver.reverse(hostname, (err, records) => { if (err) { reject(err); diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index f55b8d4a6..17754c694 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -64,7 +64,7 @@
- +
Cloudflare is the default server, you can change the resolver server anytime.