mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-09-04 09:13:21 +00:00
feat: add DNS support via Globalping (#6850)
This commit is contained in:
+3
-1
@@ -1349,7 +1349,7 @@
|
||||
"Send DOWN silently": "Send DOWN silently",
|
||||
"Installing a Nextcloud Talk bot requires administrative access to the server.": "Installing a Nextcloud Talk bot requires administrative access to the server.",
|
||||
"Globalping - Access global monitoring probes": "Globalping - Access global monitoring probes",
|
||||
"GlobalpingDescription": "Globalping provides access to thousands of community hosted probes to run network tests and measurements. A limit of 250 tests per hour is set for all anonymous users. To double the limit to 500 per hour please save your token in {accountSettings}.",
|
||||
"GlobalpingMonitorDescription": "Globalping provides access to thousands of community hosted probes to run network tests and measurements. A limit of 250 tests per hour is set for all anonymous users. To double the limit to 500 per hour please save your token in {accountSettings}. Check the {docs} for more information.",
|
||||
"Globalping API Token": "Globalping API Token",
|
||||
"globalpingApiTokenDescription": "Get your Globalping API Token at {0}.",
|
||||
"GlobalpingHostname": "A publicly reachable measurement target. Typically a hostname or IPv4/IPv6 address, depending on the measurement type.",
|
||||
@@ -1357,6 +1357,8 @@
|
||||
"GlobalpingLocationDocs": "Full location input documentation",
|
||||
"GlobalpingIpFamilyInfo": "The IP version to use. Only allowed if the target is a hostname.",
|
||||
"GlobalpingResolverInfo": "IPv4/IPv6 address or a fully Qualified Domain Name (FQDN). Defaults to the probe's local network resolver. You can change the resolver server anytime.",
|
||||
"RecordMatch": "Record value match",
|
||||
"RegexMatch": "Enter a regex to match the record value",
|
||||
"Resolver Server": "Resolver Server",
|
||||
"Protocol": "Protocol",
|
||||
"account settings": "account settings",
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
<span>{{ $t("Location") }}:</span>
|
||||
<span class="keyword">{{ monitor.location }}</span>
|
||||
<br />
|
||||
<span v-if="monitor.subtype === 'dns'">
|
||||
[{{ monitor.dns_resolve_type }}]
|
||||
<br />
|
||||
<span>{{ $t("Last Result") }}:</span>
|
||||
<span class="keyword">{{ monitor.dns_last_result }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-if="monitor.type === 'keyword'">
|
||||
<br />
|
||||
|
||||
+109
-3
@@ -10,13 +10,21 @@
|
||||
|
||||
<i18n-t
|
||||
v-if="monitor.type === 'globalping'"
|
||||
keypath="GlobalpingDescription"
|
||||
keypath="GlobalpingMonitorDescription"
|
||||
tag="p"
|
||||
class="form-text"
|
||||
>
|
||||
<template #accountSettings>
|
||||
<router-link to="/settings/general">{{ $t("account settings") }}</router-link>
|
||||
</template>
|
||||
<template #docs>
|
||||
<a
|
||||
href="https://github.com/jsdelivr/globalping?tab=readme-ov-file#uptime-monitoring-use-cases"
|
||||
target="_blank"
|
||||
>
|
||||
{{ $t("documentation") }}
|
||||
</a>
|
||||
</template>
|
||||
</i18n-t>
|
||||
|
||||
<div class="my-3">
|
||||
@@ -122,6 +130,7 @@
|
||||
>
|
||||
<option value="ping">Ping</option>
|
||||
<option value="http">HTTP(s)</option>
|
||||
<option value="dns">DNS</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -472,7 +481,7 @@
|
||||
<!-- Globalping -->
|
||||
<template v-if="monitor.type === 'globalping'">
|
||||
<!-- Hostname -->
|
||||
<div v-if="monitor.subtype === 'ping'" class="my-3">
|
||||
<div v-if="monitor.subtype === 'ping' || monitor.subtype === 'dns'" class="my-3">
|
||||
<label for="hostname" class="form-label">{{ $t("Hostname") }}</label>
|
||||
<input
|
||||
id="hostname"
|
||||
@@ -548,7 +557,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="monitor.subtype === 'http'" class="my-3">
|
||||
<div v-if="monitor.subtype === 'http' || monitor.subtype === 'dns'" class="my-3">
|
||||
<label for="dns_resolve_server" class="form-label">
|
||||
{{ $t("Resolver Server") }}
|
||||
</label>
|
||||
@@ -563,6 +572,67 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DNS -->
|
||||
<template v-if="monitor.subtype === 'dns'">
|
||||
<!-- 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"
|
||||
value="53"
|
||||
/>
|
||||
<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>
|
||||
|
||||
<!-- :allow-empty="false" is not working, set a default value instead https://github.com/shentao/vue-multiselect/issues/336 -->
|
||||
<VueMultiselect
|
||||
id="dns_resolve_type"
|
||||
v-model="monitor.dns_resolve_type"
|
||||
:options="globalpingdnsresolvetypeoptions"
|
||||
:multiple="false"
|
||||
:close-on-select="true"
|
||||
:clear-on-select="false"
|
||||
:preserve-search="false"
|
||||
:placeholder="$t('Pick a RR-Type...')"
|
||||
:preselect-first="false"
|
||||
:max-height="500"
|
||||
:taggable="false"
|
||||
data-testid="resolve-type-select"
|
||||
></VueMultiselect>
|
||||
|
||||
<div class="form-text">
|
||||
{{ $t("rrtypeDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="my-3">
|
||||
<label for="keyword" class="form-label">{{ $t("RecordMatch") }}</label>
|
||||
<input
|
||||
id="keyword"
|
||||
v-model="monitor.keyword"
|
||||
type="text"
|
||||
class="form-control"
|
||||
/>
|
||||
<div class="form-text">
|
||||
{{ $t("RegexMatch") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Protocol -->
|
||||
<div class="my-3">
|
||||
<label for="protocol" class="form-label">{{ $t("Protocol") }}</label>
|
||||
@@ -575,6 +645,10 @@
|
||||
<option :value="null">{{ $t("auto-select") }}</option>
|
||||
<option value="HTTP2">HTTP2</option>
|
||||
</template>
|
||||
<template v-else-if="monitor.subtype === 'dns'">
|
||||
<option value="UDP">UDP</option>
|
||||
<option value="TCP">TCP</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
@@ -2829,6 +2903,7 @@ export default {
|
||||
acceptedStatusCodeOptions: [],
|
||||
acceptedWebsocketCodeOptions: [],
|
||||
dnsresolvetypeOptions: [],
|
||||
globalpingdnsresolvetypeoptions: [],
|
||||
kafkaSaslMechanismOptions: [],
|
||||
gameList: null,
|
||||
connectionStringTemplates: {
|
||||
@@ -3310,14 +3385,26 @@ message HealthCheckResponse {
|
||||
if (!oldSubtype && !this.monitor.protocol) {
|
||||
if (newSubtype === "ping") {
|
||||
this.monitor.protocol = "ICMP";
|
||||
} else if (newSubtype === "dns") {
|
||||
this.monitor.protocol = "UDP";
|
||||
} else if (newSubtype === "http") {
|
||||
this.monitor.protocol = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!oldSubtype && this.monitor.port === undefined) {
|
||||
if (newSubtype === "dns") {
|
||||
this.monitor.port = "53";
|
||||
}
|
||||
}
|
||||
|
||||
if (newSubtype !== oldSubtype) {
|
||||
if (newSubtype === "ping") {
|
||||
this.monitor.protocol = "ICMP";
|
||||
this.monitor.port = "80";
|
||||
} else if (newSubtype === "dns") {
|
||||
this.monitor.protocol = "UDP";
|
||||
this.monitor.port = "53";
|
||||
} else if (newSubtype === "http") {
|
||||
this.monitor.protocol = null;
|
||||
}
|
||||
@@ -3364,6 +3451,24 @@ message HealthCheckResponse {
|
||||
let acceptedWebsocketCodeOptions = [];
|
||||
|
||||
let dnsresolvetypeOptions = ["A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SRV", "TXT"];
|
||||
const globalpingdnsresolvetypeoptions = [
|
||||
"A",
|
||||
"AAAA",
|
||||
"ANY",
|
||||
"CNAME",
|
||||
"DNSKEY",
|
||||
"DS",
|
||||
"HTTPS",
|
||||
"MX",
|
||||
"NS",
|
||||
"NSEC",
|
||||
"PTR",
|
||||
"RRSIG",
|
||||
"SOA",
|
||||
"SRV",
|
||||
"SVCB",
|
||||
"TXT",
|
||||
];
|
||||
|
||||
let kafkaSaslMechanismOptions = ["None", "plain", "scram-sha-256", "scram-sha-512", "aws"];
|
||||
|
||||
@@ -3378,6 +3483,7 @@ message HealthCheckResponse {
|
||||
this.acceptedWebsocketCodeOptions = acceptedWebsocketCodeOptions;
|
||||
this.acceptedStatusCodeOptions = acceptedStatusCodeOptions;
|
||||
this.dnsresolvetypeOptions = dnsresolvetypeOptions;
|
||||
this.globalpingdnsresolvetypeoptions = globalpingdnsresolvetypeoptions;
|
||||
this.kafkaSaslMechanismOptions = kafkaSaslMechanismOptions;
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user