fix(globalping): show error message when using multiple locations (#7055)

This commit is contained in:
Radu Lucuț
2026-02-26 17:34:00 +01:00
committed by GitHub
parent 86b86fae55
commit b36a8b035b
2 changed files with 14 additions and 2 deletions
+2 -1
View File
@@ -1377,8 +1377,9 @@
"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.",
"GlobalpingLocation": "The location field accepts continents, countries, regions, cities, ASNs, ISPs, or cloud regions. You can combine filters with {plus} (e.g {amazonPlusGermany} or {comcastPlusCalifornia}). If latency is an important metric, use filters to narrow down the location to a small region to avoid spikes. {fullDocs}.",
"GlobalpingLocationDescription": "The location field accepts continents, countries, regions, cities, ASNs, ISPs, or cloud regions. You can combine filters with {plus} (e.g {amazonPlusGermany} or {comcastPlusCalifornia}). If latency is an important metric, use filters to narrow down the location to a small region to avoid spikes and for better stability set the {datacenter} filter. {fullDocs}.",
"GlobalpingLocationDocs": "Full location input documentation",
"GlobalpingMultipleLocationsError": "Multiple locations are not supported, please use a single location for each monitor.",
"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",
+12 -1
View File
@@ -536,7 +536,7 @@
class="form-control"
required
/>
<i18n-t keypath="GlobalpingLocation" tag="div" class="form-text">
<i18n-t keypath="GlobalpingLocationDescription" tag="div" class="form-text">
<template #plus>
<code>+</code>
</template>
@@ -546,6 +546,9 @@
<template #comcastPlusCalifornia>
<code>comcast+california</code>
</template>
<template #datacenter>
<code>+datacenter</code>
</template>
<template #fullDocs>
<a
href="https://github.com/jsdelivr/globalping?tab=readme-ov-file#basic-location-targeting-"
@@ -3704,6 +3707,14 @@ message HealthCheckResponse {
}
}
// Validate Globalping location if present
if (this.monitor.type === "globalping" && this.monitor.location) {
if (this.monitor.location.includes(",")) {
toast.error(this.$t("GlobalpingMultipleLocationsError"));
return false;
}
}
// Validate hostname field input for various monitors
if (
["dns", "port", "ping", "steam", "gamedig", "radius", "tailscale-ping", "smtp", "snmp"].includes(