diff --git a/apps/web/src/views/partials/monitor-form-js.ejs b/apps/web/src/views/partials/monitor-form-js.ejs index 44c4ffe..33d4aae 100644 --- a/apps/web/src/views/partials/monitor-form-js.ejs +++ b/apps/web/src/views/partials/monitor-form-js.ejs @@ -49,6 +49,7 @@ const rb = document.getElementById(prefix + 'request-body').value.trim(); body.request_body = rb || null; body.regions = [...document.querySelectorAll('.' + prefix + 'region-check:checked')].map(el => el.value); + if (!body.regions.length) throw new Error('Select at least one region'); if (_currentQuery) body.query = _currentQuery; return body; } diff --git a/apps/web/src/views/partials/monitor-form.ejs b/apps/web/src/views/partials/monitor-form.ejs index e2572f1..c34ee73 100644 --- a/apps/web/src/views/partials/monitor-form.ejs +++ b/apps/web/src/views/partials/monitor-form.ejs @@ -81,12 +81,16 @@ + <% + // Default to eu-central if no regions selected + const selectedRegions = (monitor.regions && monitor.regions.length) ? monitor.regions : ['eu-central']; + %>
- +
<% regions.forEach(function([val, label]) { %> <% }) %>