%~ include('./partials/head', { title: 'Monitors' }) %> <%~ include('./partials/nav', { nav: 'monitors' }) %> <% const upCount = it.monitors.filter(m => m.last_ping && m.last_ping.up === true).length; const downCount = it.monitors.filter(m => m.last_ping && m.last_ping.up === false).length; %> Monitors <% if (it.monitors.length > 0) { %><%= upCount %> up · <%= downCount %> down · <%= it.monitors.length %> total<% } %> + New <% if (it.monitors.length === 0) { %> No monitors yet Create your first monitor <% } else { %> <% it.monitors.forEach(function(m) { const latencies = (m.pings || []).filter(p => p.latency_ms != null); const avgLatency = latencies.length ? Math.round(latencies.reduce((a, b) => a + b, 0) / latencies.length) : null; %> <%= m.name %> <%= m.url %> <%~ it.sparklineSSR(latencies) %> <%= avgLatency != null ? avgLatency + 'ms' : '—' %> <%~ m.last_ping ? it.timeAgoSSR(m.last_ping.checked_at) : 'no pings' %> <%= m.enabled ? m.interval_s + 's' : 'paused' %> <% }) %> <% } %> <%~ include('./partials/foot') %>
No monitors yet