Skip to content

Commit b36a8b0

Browse files
authored
fix(globalping): show error message when using multiple locations (louislam#7055)
1 parent 86b86fa commit b36a8b0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,8 +1377,9 @@
13771377
"Globalping API Token": "Globalping API Token",
13781378
"globalpingApiTokenDescription": "Get your Globalping API Token at {0}.",
13791379
"GlobalpingHostname": "A publicly reachable measurement target. Typically a hostname or IPv4/IPv6 address, depending on the measurement type.",
1380-
"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}.",
1380+
"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}.",
13811381
"GlobalpingLocationDocs": "Full location input documentation",
1382+
"GlobalpingMultipleLocationsError": "Multiple locations are not supported, please use a single location for each monitor.",
13821383
"GlobalpingIpFamilyInfo": "The IP version to use. Only allowed if the target is a hostname.",
13831384
"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.",
13841385
"RecordMatch": "Record value match",

src/pages/EditMonitor.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@
536536
class="form-control"
537537
required
538538
/>
539-
<i18n-t keypath="GlobalpingLocation" tag="div" class="form-text">
539+
<i18n-t keypath="GlobalpingLocationDescription" tag="div" class="form-text">
540540
<template #plus>
541541
<code>+</code>
542542
</template>
@@ -546,6 +546,9 @@
546546
<template #comcastPlusCalifornia>
547547
<code>comcast+california</code>
548548
</template>
549+
<template #datacenter>
550+
<code>+datacenter</code>
551+
</template>
549552
<template #fullDocs>
550553
<a
551554
href="https://github.com/jsdelivr/globalping?tab=readme-ov-file#basic-location-targeting-"
@@ -3704,6 +3707,14 @@ message HealthCheckResponse {
37043707
}
37053708
}
37063709
3710+
// Validate Globalping location if present
3711+
if (this.monitor.type === "globalping" && this.monitor.location) {
3712+
if (this.monitor.location.includes(",")) {
3713+
toast.error(this.$t("GlobalpingMultipleLocationsError"));
3714+
return false;
3715+
}
3716+
}
3717+
37073718
// Validate hostname field input for various monitors
37083719
if (
37093720
["dns", "port", "ping", "steam", "gamedig", "radius", "tailscale-ping", "smtp", "snmp"].includes(

0 commit comments

Comments
 (0)