<% const monitor = it._form?.monitor || {}; const isEdit = !!it._form?.isEdit; const prefix = it._form?.prefix || ''; const bg = it._form?.bg || 'bg-gray-900'; const border = it._form?.border || 'border-gray-800'; const plan = it.plan || 'free'; const minInterval = { free: 30, pro: 2, lifetime: 2 }[plan] || 30; const btnText = isEdit ? 'Save Changes' : 'Create Monitor'; const formId = prefix + 'form'; const methods = ['GET','POST','PUT','PATCH','DELETE','HEAD','OPTIONS']; const allIntervals = [['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 = allIntervals.filter(([val]) => Number(val) >= minInterval); 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 curMethod = monitor.method || 'GET'; const bodyHidden = ['GET','HEAD','OPTIONS'].includes(curMethod); %>
<% if (monitor.request_headers && typeof monitor.request_headers === 'object') { Object.entries(monitor.request_headers).forEach(function([k, v]) { %>
<% }) } %>
<% // Default to all regions if none selected const selectedRegions = (monitor.regions && monitor.regions.length) ? monitor.regions : regions.map(r => r[0]); %>
<% regions.forEach(function([val, label]) { %> <% }) %>

Define <% if (isEdit) { %>up/down conditions<% } else { %>when this monitor should be considered "up"<% } %>. Defaults to status < 400.