Merge pull request #1473 from Computroniks/#1059-specify-dns-resolver-port

Added #1059: Allow to specify Resolver Port for DNS Monitor
This commit is contained in:
Louis Lam 2022-05-25 14:59:14 +08:00 committed by GitHub
commit 35b8e89457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 3 deletions

View file

@ -94,6 +94,15 @@
</div>
</div>
<!-- Port -->
<div class="my-3">
<label for="port" class="form-label">{{ $t("Port") }}</label>
<input id="port" v-model="monitor.port" type="number" class="form-control" required min="0" max="65535" step="1">
<div class="form-text">
{{ $t("dnsPortDescription") }}
</div>
</div>
<div class="my-3">
<label for="dns_resolve_type" class="form-label">{{ $t("Resource Record Type") }}</label>
@ -469,6 +478,15 @@ export default {
this.monitor.pushToken = genSecret(10);
}
}
// Set default port for DNS if not already defined
if (! this.monitor.port || this.monitor.port === "53") {
if (this.monitor.type === "dns") {
this.monitor.port = "53";
} else {
this.monitor.port = "";
}
}
}
},