<%~ include('./partials/head', { title: 'Monitor', scripts: ['/dashboard/query-builder.js'] }) %> <%~ include('./partials/nav', { nav: 'monitors' }) %> <% const m = it.monitor; const pings = it.pings || []; const lastPing = pings[0]; const upPings = pings.filter(p => p.up); const latencies = pings.filter(p => p.latency_ms != null).map(p => p.latency_ms); const avgLatency = latencies.length ? Math.round(latencies.reduce((a, b) => a + b, 0) / latencies.length) : null; const uptime = pings.length ? Math.round((upPings.length / pings.length) * 100) : null; const barPings = pings.slice(0, 60).reverse(); const chartPings = pings.slice().reverse(); %>
← Back
<%~ lastPing ? (lastPing.up ? '' : '') : '' %>

<%= m.name %>

<%= m.url %>

Status
<%~ lastPing ? (lastPing.up ? 'Up' : 'Down') : '' %>
Avg Latency
<%= avgLatency != null ? avgLatency + 'ms' : '—' %>
Uptime
<%= uptime != null ? uptime + '%' : '—' %>
Last Ping
<%~ lastPing ? it.timeAgoSSR(lastPing.checked_at) : '—' %>

Response Time

Status History

<% if (barPings.length > 0) { %> <% barPings.forEach(function(c) { %>
<% }) %> <% } else { %>
No data
<% } %>

Recent Pings

<% const regionFlag = { 'eu-central': '🇩🇪', 'us-east': '🇺🇸', 'us-west': '🇺🇸', 'ap-southeast': '🇸🇬', }; %> <% pings.slice(0, 30).forEach(function(c) { %> <% }) %>
Status Code Latency Region Run ID Time / Jitter Error
<%~ c.up ? 'Up' : 'Down' %> <%= c.status_code != null ? c.status_code : '—' %> <%= c.latency_ms != null ? c.latency_ms + 'ms' : '—' %> <%= c.region ? (regionFlag[c.region] || '🌐') + ' ' + c.region : '—' %> <%= c.run_id ? c.run_id.slice(0, 8) + '…' : '—' %> <%~ it.timeAgoSSR(c.checked_at) %><% if (c.jitter_ms != null) { %> (+<%= c.jitter_ms %>ms)<% } %> <%= c.error ? c.error : '' %>

Edit Monitor

<%~ include('./partials/monitor-form', { _form: { monitor: m, isEdit: true, prefix: 'edit-', bg: 'bg-gray-800', border: 'border-gray-700' } }) %>
<%~ include('./partials/foot') %>