% const palette = ['#cee5ff', '#39a8ff', '#ffcf5f', '#ff7a7a', '#c08bff', '#5ff0d0', '#ff9f43', '#8fbf00', '#ff5fd2', '#7a8cff']; const flag = (cc) => { if (!cc || cc.length !== 2) { return ''; } return String.fromCodePoint(...[...cc.toUpperCase()].map(c => 0x1F1E6 + c.charCodeAt(0) - 65)); }; const maxOf = (arr, key) => arr.reduce((m, e) => Math.max(m, e[key]), 0) || 1; const urlMax = maxOf(topUrls, 'count'); const countryMax = maxOf(topCountries, 'count'); const providerMax = maxOf(topProviders, 'count'); const browserMax = maxOf(browsers, 'count'); const osMax = maxOf(operatingSystems, 'count'); const deviceMax = maxOf(devices, 'count'); const dailyMax = maxOf(daily, 'count'); const hourMax = maxOf(hourly, 'count'); const dailyTotal = daily.reduce((s, d) => s + d.count, 0); const hourlyTotal = hourly.reduce((s, h) => s + h.count, 0); const totalCountry = topCountries.reduce((s, c) => s + c.count, 0) || 1; let acc = 0; const stops = []; topCountries.slice(0, 6).forEach((c, i) => { const start = (acc / totalCountry) * 360; acc += c.count; const end = (acc / totalCountry) * 360; stops.push(`${palette[i]} ${start}deg ${end}deg`); }); if (acc < totalCountry) { stops.push(`#333 ${(acc / totalCountry) * 360}deg 360deg`); } const conic = stops.length ? `conic-gradient(${stops.join(', ')})` : 'var(--admin-surface-3)'; const dowLabels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; const fmtRange = (d) => d ? new Date(d).toLocaleString() : 'n/a'; %>
<%- include('../partials/head'); -%> <%- include('../partials/admin-base'); -%>No visits recorded in this period.
<% } %>No visits recorded in this period.
<% } %>No page data yet.
<% } %>No geolocation data yet.
<% } %>No provider data yet.
<% } %>No user agent data yet.
<% } %>No OS data yet.
<% } %>No device data yet.
<% } %>No activity to display yet.
<% } %>| IP | Location | ISP | Visits | |
|---|---|---|---|---|
| <%= ip.ip %> | <% if (ip.info.country) { %> <%= flag(ip.info.countryCode) %> <%= [ip.info.city, ip.info.country].filter(Boolean).join(', ') %> <% } else { %> Unknown <% } %> | <%= ip.info.isp || ip.info.org || '—' %> | <%= ip.count %> | Details |
| No visitors yet. | ||||