chore: add more timeout options, default to 10s

This commit is contained in:
nate 2026-03-18 20:50:16 +04:00
parent 0d059a0112
commit c74e2d3b58
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ const MonitorBody = t.Object({
method: t.Optional(t.String({ default: "GET", description: "HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD" })), method: t.Optional(t.String({ default: "GET", description: "HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD" })),
request_headers: t.Optional(t.Any({ description: "Request headers as key-value object" })), request_headers: t.Optional(t.Any({ description: "Request headers as key-value object" })),
request_body: t.Optional(t.Nullable(t.String({ maxLength: 65536, description: "Request body for POST/PUT/PATCH (max 64KB)" }))), request_body: t.Optional(t.Nullable(t.String({ maxLength: 65536, description: "Request body for POST/PUT/PATCH (max 64KB)" }))),
timeout_ms: t.Optional(t.Number({ minimum: 1000, maximum: 60000, default: 30000, description: "Request timeout in ms" })), timeout_ms: t.Optional(t.Number({ minimum: 1000, maximum: 60000, default: 10000, description: "Request timeout in ms" })),
interval_s: t.Optional(t.Number({ minimum: 2, default: 60, description: "Check interval in seconds (minimum 2)" })), interval_s: t.Optional(t.Number({ minimum: 2, default: 60, description: "Check interval in seconds (minimum 2)" })),
query: t.Optional(t.Any({ description: "PingQL query — filter conditions for up/down" })), query: t.Optional(t.Any({ description: "PingQL query — filter conditions for up/down" })),
regions: t.Optional(t.Array(t.String(), { description: "Regions to run checks from. Empty array = all regions." })), regions: t.Optional(t.Array(t.String(), { description: "Regions to run checks from. Empty array = all regions." })),

View File

@ -8,7 +8,7 @@
const formId = prefix + 'form'; const formId = prefix + 'form';
const methods = ['GET','POST','PUT','PATCH','DELETE','HEAD','OPTIONS']; const methods = ['GET','POST','PUT','PATCH','DELETE','HEAD','OPTIONS'];
const intervals = [['2','2 seconds'],['5','5 seconds'],['10','10 seconds'],['20','20 seconds'],['30','30 seconds'],['60','1 minute'],['300','5 minutes'],['600','10 minutes'],['1800','30 minutes'],['3600','1 hour']]; const intervals = [['2','2 seconds'],['5','5 seconds'],['10','10 seconds'],['20','20 seconds'],['30','30 seconds'],['60','1 minute'],['300','5 minutes'],['600','10 minutes'],['1800','30 minutes'],['3600','1 hour']];
const timeouts = [['5000','5 seconds'],['10000','10 seconds'],['30000','30 seconds'],['60000','60 seconds']]; const timeouts = [['5000','5 seconds'],['10000','10 seconds'],['20000','20 seconds'],['30000','30 seconds'],['40000','40 seconds'],['50000','50 seconds'],['60000','60 seconds']];
const regions = [['eu-central','🇩🇪 EU Central'],['us-west','🇺🇸 US West']]; const regions = [['eu-central','🇩🇪 EU Central'],['us-west','🇺🇸 US West']];
const curMethod = monitor.method || 'GET'; const curMethod = monitor.method || 'GET';
const bodyHidden = ['GET','HEAD','OPTIONS'].includes(curMethod); const bodyHidden = ['GET','HEAD','OPTIONS'].includes(curMethod);
@ -75,7 +75,7 @@
<select id="<%= prefix %>timeout" <select id="<%= prefix %>timeout"
class="w-full <%= bg %> border <%= border %> rounded-lg px-4 py-2.5 text-gray-100 focus:outline-none focus:border-blue-500"> class="w-full <%= bg %> border <%= border %> rounded-lg px-4 py-2.5 text-gray-100 focus:outline-none focus:border-blue-500">
<% timeouts.forEach(function([val, label]) { %> <% timeouts.forEach(function([val, label]) { %>
<option value="<%= val %>" <%= String(monitor.timeout_ms || '30000') === val ? 'selected' : '' %>><%= label %></option> <option value="<%= val %>" <%= String(monitor.timeout_ms || '10000') === val ? 'selected' : '' %>><%= label %></option>
<% }) %> <% }) %>
</select> </select>
</div> </div>