Link-domain pool by channel + safety checks, hosted page images + provider allowlist, Reports pages and zones sections
Item 1 (domains.js): every short link domain in linkDomains gets a channel (email / messaging / social / reserve)
via the new linkDomainChannels site setting ("host:channel,..."; default order email, messaging, social, email,
reserve). Checks every 6 h + Admin > Link domains "Check now": Google Safe Browsing v4 when GSB_API_KEY is set
(unknown otherwise), URIBL + SURBL DNS lists (answer = listed, NXDOMAIN = clean, 127.0.0.1 or errors = unknown),
and a TelegramBot-UA reachability probe. Flagged or listed = BURNED: out of domains.live() (no new links or
pages on it, existing /r/ codes still resolve), admin told once via telegramAdminChatId or ADMIN_EMAIL.
State in DATA_DIR/domains.json. New: GET /api/my/link-hosts, GET+POST /api/admin/domains, admin pane.
/api/my/pages now hands out hosts from domains.live().
Item 2 (pages.js, formrestyle.js): POST /api/my/pages/upload (raw image body, multipart, or JSON base64) for
png/jpg/webp up to 2 MB, 50 per member, magic bytes checked, sharp re-encode when installed, stored under
DATA_DIR/uploads/pages/<owner-hash>/<id>.<ext>, served at /u/pages/... immutable for a year; delete via
POST /api/my/pages/images/<id> {remove}. Pages editor: Upload image button beside the image field + a strip of
the member's images. Provider allowlist (17 autoresponders, Sendy by /subscribe path) exposed as `providers`;
the editor says "Recognised: AWeber" or "Unknown provider: plain post to <host>" at paste time; pub() carries
formProvider. Unknown hosts still allowed when parse-or-refuse passes.
Item 3 (zonereport.js, pages.summary): /api/my/reports returns {spins, pages, zones} (spins still spread at the
top level) for the chosen days; Pages and Zones sections on /reports with 30-day bars, totals, per-item tables,
phone width checked. Zone numbers are a read-only view over zones.json (zones.js untouched).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -99,6 +99,7 @@
|
||||
<button data-pane="reports" type="button"><svg viewBox="0 0 24 24"><path d="M12 3l9 16H3z"/><path d="M12 10v4M12 17v.5"/></svg>Reports<span class="pill" id="repBadge" hidden></span></button>
|
||||
<button data-pane="traffic" type="button"><svg viewBox="0 0 24 24"><path d="M3 17l6-6 4 4 8-8"/><path d="M14 7h7v7"/></svg>Traffic</button>
|
||||
<button data-pane="zones" type="button"><svg viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18M8 15h8"/></svg>Zones</button>
|
||||
<button data-pane="domains" type="button"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>Link domains</button>
|
||||
<button data-pane="blog" type="button"><svg viewBox="0 0 24 24"><path d="M4 4h12l4 4v12H4z"/><path d="M8 12h8M8 16h8M8 8h4"/></svg>Blog</button>
|
||||
<button data-pane="releases" type="button"><svg viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h7"/><circle cx="18" cy="17" r="3"/></svg>Releases</button>
|
||||
<button data-pane="pnl" type="button"><svg viewBox="0 0 24 24"><path d="M4 19V5M4 19h16"/><path d="M8 15l3-4 3 2 5-6"/></svg>P&L</button>
|
||||
@@ -294,6 +295,14 @@
|
||||
<p style="margin:0 0 6px;display:flex;gap:8px;align-items:center"><input class="tfilter small" data-for="znTable" placeholder="Filter zones" style="max-width:260px"><span class="tfilter-count muted small"></span></p><div class="tablewrap"><table class="adm-table" id="znTable"></table></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pane" id="pane-domains" hidden>
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>Link domains</h3><span class="sub" id="dmSub"></span></div>
|
||||
<p class="muted small" style="margin:0 0 10px" id="dmRules">Every short link domain belongs to one channel so a burn on one channel never takes the others down: email (mailings and safelists), messaging (Telegram, WhatsApp, SMS), social (X, Facebook, forums) or reserve (held back, never handed out). Checks run every six hours: Google Safe Browsing (needs GSB_API_KEY on the server), URIBL and SURBL lists, and a Telegram-style reachability probe. A flagged or listed domain is burned: no new links or pages go on it, existing /r/ links still resolve, and you are told once.</p>
|
||||
<p style="margin:0 0 8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap"><button class="btn small" id="dmCheckAll" type="button">Check all now</button><span class="muted small" id="dmGsb"></span></p>
|
||||
<div class="tablewrap"><table class="adm-table" id="dmTable"></table></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pane" id="pane-traffic" hidden>
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>Where visitors come from</h3><span class="sub" id="trfSub"></span></div>
|
||||
@@ -495,6 +504,6 @@
|
||||
</div>
|
||||
|
||||
<script src="/assets/common.js?v=20261009a"></script>
|
||||
<script src="/assets/admin.js?v=20260929a"></script>
|
||||
<script src="/assets/admin.js?v=20261010a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+24
-2
@@ -44,8 +44,8 @@
|
||||
});
|
||||
|
||||
// ── panes ──
|
||||
const TITLES = { overview: 'Overview', house: 'House ads', campaigns: 'All campaigns', members: 'Members', reports: 'Reports', zones: 'Zones', traffic: 'Traffic', blog: 'Blog', releases: 'Releases and roadmap', pnl: 'Profit and loss', settings: 'Settings' };
|
||||
const loaders = { overview: loadOverview, house: loadHouse, campaigns: loadCampaigns, members: loadMembers, reports: loadReports, zones: loadZones, traffic: loadTraffic, blog: loadBlog, releases: loadReleases, pnl: loadPnl, settings: loadSettings };
|
||||
const TITLES = { overview: 'Overview', house: 'House ads', campaigns: 'All campaigns', members: 'Members', reports: 'Reports', zones: 'Zones', domains: 'Link domains', traffic: 'Traffic', blog: 'Blog', releases: 'Releases and roadmap', pnl: 'Profit and loss', settings: 'Settings' };
|
||||
const loaders = { overview: loadOverview, house: loadHouse, campaigns: loadCampaigns, members: loadMembers, reports: loadReports, zones: loadZones, domains: loadDomains, traffic: loadTraffic, blog: loadBlog, releases: loadReleases, pnl: loadPnl, settings: loadSettings };
|
||||
function setPane(name) {
|
||||
if (!TITLES[name]) name = 'overview';
|
||||
document.querySelectorAll('.pane').forEach(p => { p.hidden = p.id !== 'pane-' + name; });
|
||||
@@ -488,6 +488,28 @@
|
||||
try { await api('/api/admin/zones/' + b.dataset.znpause, pausing ? { paused: true, note: 'Paused ' + new Date().toLocaleDateString() } : { paused: false, note: '' }, 'POST'); loadZones(); } catch (e) { IAP.status(e.message, 'bad'); }
|
||||
}));
|
||||
}
|
||||
// ── link domains: channel per domain, last safety check, burned flag; check now / clear / pull (2026-10-10) ──
|
||||
async function loadDomains() {
|
||||
const d = await api('/api/admin/domains');
|
||||
const list = d.domains || []; const live = list.filter(x => !x.burned && x.channel !== 'reserve').length, burned = list.filter(x => x.burned).length;
|
||||
$('dmSub').textContent = list.length + ' domain' + (list.length === 1 ? '' : 's') + ' · ' + live + ' live · ' + burned + ' burned';
|
||||
$('dmGsb').textContent = d.gsb ? 'Google Safe Browsing: on' : 'Google Safe Browsing: off (set GSB_API_KEY on the server to turn it on)';
|
||||
const ago = t => t ? new Date(t).toLocaleString() : 'never';
|
||||
const mark = v => v === 'clean' ? '<span style="color:var(--ok,#2e9b5a)">clean</span>' : v === 'flagged' || v === 'listed' ? '<b style="color:var(--bad)">' + v + '</b>' : /^ok:/.test(v || '') ? '<span style="color:var(--ok,#2e9b5a)">answered ' + esc(v.slice(3)) + '</span>' : '<span class="muted">unknown</span>';
|
||||
$('dmTable').innerHTML = '<tr><th>Domain</th><th>Channel</th><th>Safe Browsing</th><th>URIBL</th><th>SURBL</th><th>Reach</th><th>Status</th><th>Last check</th><th></th></tr>'
|
||||
+ (list.length ? list.map(x => '<tr' + (x.burned ? ' style="background:rgba(192,57,43,.08)"' : '') + '><td><b>' + esc(x.host) + '</b></td>'
|
||||
+ '<td><select data-dmch="' + esc(x.host) + '">' + (d.channels || []).map(c => '<option value="' + c + '"' + (c === x.channel ? ' selected' : '') + '>' + esc(d.labels[c] || c) + '</option>').join('') + '</select><br><span class="muted small">' + esc(d.notes[x.channel] || '') + '</span></td>'
|
||||
+ '<td>' + mark(x.gsb) + '</td><td>' + mark(x.uribl) + '</td><td>' + mark(x.surbl) + '</td><td>' + mark(x.reach) + '</td>'
|
||||
+ '<td>' + (x.burned ? '<b style="color:var(--bad)">BURNED</b><br><span class="muted small">' + esc(x.reason || '') + (x.burnedAt ? ' · ' + ago(x.burnedAt) : '') + '</span>' : x.channel === 'reserve' ? '<span class="muted">held in reserve</span>' : '<span style="color:var(--ok,#2e9b5a)">live</span>') + '</td>'
|
||||
+ '<td>' + ago(x.checkedAt) + '</td>'
|
||||
+ '<td class="act" style="white-space:nowrap"><button type="button" class="btn small ghost" data-dmcheck="' + esc(x.host) + '">Check now</button> ' + (x.burned ? '<button type="button" class="btn small sec" data-dmclear="' + esc(x.host) + '">Clear burn</button>' : '<button type="button" class="btn small sec" data-dmburn="' + esc(x.host) + '">Pull</button>') + '</td></tr>').join('')
|
||||
: '<tr><td colspan="9" class="muted">No link domains yet. Add them to the linkDomains site setting (comma list) first.</td></tr>');
|
||||
document.querySelectorAll('[data-dmch]').forEach(sel => sel.addEventListener('change', async () => { try { await api('/api/admin/domains', { action: 'channel', domain: sel.dataset.dmch, channel: sel.value }); IAP.status('Channel saved: ' + sel.dataset.dmch + ' is now ' + sel.value + '.', 'ok'); loadDomains(); } catch (e) { IAP.status(e.message, 'bad'); } }));
|
||||
document.querySelectorAll('[data-dmcheck]').forEach(b => b.addEventListener('click', busy(b, async () => { const r = await api('/api/admin/domains', { action: 'check', domain: b.dataset.dmcheck }); const x = r.domain || {}; IAP.status(b.dataset.dmcheck + ': Safe Browsing ' + x.gsb + ', URIBL ' + x.uribl + ', SURBL ' + x.surbl + ', reach ' + x.reach + (x.burned ? ' · BURNED' : ''), x.burned ? 'bad' : 'ok'); loadDomains(); })));
|
||||
document.querySelectorAll('[data-dmclear]').forEach(b => b.addEventListener('click', busy(b, async () => { await api('/api/admin/domains', { action: 'clear', domain: b.dataset.dmclear }); IAP.status(b.dataset.dmclear + ' is back in the pool.', 'ok'); loadDomains(); })));
|
||||
document.querySelectorAll('[data-dmburn]').forEach(b => b.addEventListener('click', busy(b, async () => { await api('/api/admin/domains', { action: 'burn', domain: b.dataset.dmburn, reason: 'pulled by admin ' + new Date().toLocaleDateString() }); IAP.status(b.dataset.dmburn + ' pulled from the pool.', 'ok'); loadDomains(); })));
|
||||
}
|
||||
$('dmCheckAll').addEventListener('click', busy($('dmCheckAll'), async () => { IAP.status('Checking every domain…', 'ok'); const r = await api('/api/admin/domains', { action: 'check' }); const bad = (r.domains || []).filter(x => x.burned).length; IAP.status('Checked ' + (r.results || []).length + ' domains' + (bad ? ', ' + bad + ' burned' : ', none burned') + '.', bad ? 'bad' : 'ok'); loadDomains(); }));
|
||||
// ── traffic: referring domains / sources, landing pages, angles, by day ──
|
||||
let trfDays = 30;
|
||||
document.querySelectorAll('#trfRange [data-days]').forEach(b => b.addEventListener('click', () => { trfDays = Number(b.dataset.days); document.querySelectorAll('#trfRange [data-days]').forEach(x => x.classList.toggle('on', x === b)); loadTraffic().catch(e => IAP.status(e.message, 'bad')); }));
|
||||
|
||||
@@ -2,12 +2,48 @@
|
||||
(function () {
|
||||
const $ = id => document.getElementById(id); const esc = CR.esc, fmt = CR.fmt, api = CR.api, toast = CR.toast, dialog = CR.dialog;
|
||||
let PAGES = [], SEL = null, SCAN = null, TYPE = 'bridge', HOSTS = [], BASE = '';
|
||||
let STYLES = { palettes: [], designs: [], layouts: [], niches: [] };
|
||||
let STYLES = { palettes: [], designs: [], layouts: [], niches: [] }, PROVIDERS = [], IMAGES = [], IMG_MAX = 50, IMG_BYTES = 2 * 1024 * 1024;
|
||||
// which autoresponder a pasted form posts to (same list the server keeps in formrestyle.js, handed over as `providers`)
|
||||
function providerOf(embed) {
|
||||
const f = /<form\b[^>]*>/i.exec(String(embed || '')); if (!f) return null;
|
||||
const am = /\baction\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/i.exec(f[0]); const action = am ? (am[1] || am[2] || am[3]) : '';
|
||||
if (!/^https?:\/\//i.test(action)) return null;
|
||||
let u; try { u = new URL(action); } catch (e) { return null; }
|
||||
const host = u.hostname.toLowerCase().replace(/^www\./, '');
|
||||
for (const pr of PROVIDERS) { const hostHit = (pr.hosts || []).some(h => host === h || host.endsWith('.' + h)); const pathHit = pr.path ? new RegExp(pr.path, 'i').test(u.pathname) : false; if ((pr.hosts && pr.hosts.length && hostHit) || (!(pr.hosts && pr.hosts.length) && pathHit)) return { host, known: true, name: pr.name }; }
|
||||
return { host, known: false, name: '' };
|
||||
}
|
||||
function providerNote(embed) {
|
||||
const el = $('providerNote'); if (!el) return; const src = String(embed || '').trim();
|
||||
if (!src) { el.hidden = true; el.innerHTML = ''; return; }
|
||||
const pr = providerOf(src); el.hidden = false;
|
||||
if (!pr) { el.innerHTML = '<span class="warn">No https:// form action found yet.</span> Paste the whole <form> block your provider gives you.'; return; }
|
||||
el.innerHTML = pr.known ? '<span class="ok"><span class="dot"></span>Recognised: ' + esc(pr.name) + '</span> <span class="muted">Submissions go to ' + esc(pr.host) + '.</span>'
|
||||
: '<span class="warn"><span class="dot"></span>Unknown provider</span> <span class="muted">The form is kept as a plain post to <b>' + esc(pr.host) + '</b>; we cannot vouch for it. It still has to pass the form check when you save.</span>';
|
||||
}
|
||||
// the member's hosted images: a strip of thumbnails under the image field, click to use, x to delete
|
||||
function drawImages() {
|
||||
const box = $('imgStrip'); if (!box) return;
|
||||
box.innerHTML = (IMAGES.length ? IMAGES.map(i => '<span class="im" data-url="' + esc(i.url) + '" title="Use this image"><img src="' + esc(i.url) + '" alt="" loading="lazy"><button type="button" class="x" data-del="' + i.id + '" title="Delete this image">×</button></span>').join('') : '<span class="muted" style="font-size:11px">No uploads yet. PNG, JPG or WebP up to 2 MB, ' + IMG_MAX + ' per account.</span>')
|
||||
+ (IMAGES.length ? '<span class="muted mono" style="font-size:11px;align-self:center">' + IMAGES.length + '/' + IMG_MAX + '</span>' : '');
|
||||
box.querySelectorAll('.im').forEach(s => s.addEventListener('click', e => { if (e.target.closest('[data-del]')) return; const f = $('f-image'); if (f) { f.value = s.dataset.url; f.dispatchEvent(new Event('input')); toast('Image URL filled in. Save to keep it.'); } }));
|
||||
box.querySelectorAll('[data-del]').forEach(b => b.addEventListener('click', async e => { e.stopPropagation(); if (!await dialog({ title: 'Delete this image?', text: 'Pages that still point at it will show no image.', ok: 'Delete', danger: true })) return; try { const r = await api('/api/my/pages/images/' + b.dataset.del, { remove: true }); IMAGES = r.images || []; drawImages(); } catch (er) { toast(er.message, true); } }));
|
||||
}
|
||||
async function uploadFile(file) {
|
||||
if (!file) return; if (!/^image\/(png|jpeg|webp)$/.test(file.type)) return toast('Use a PNG, JPG or WebP image.', true);
|
||||
if (file.size > IMG_BYTES) return toast('That image is over 2 MB. Make it smaller and try again.', true);
|
||||
const btn = $('imgUpload'); if (btn) { btn.disabled = true; btn.textContent = 'Uploading…'; }
|
||||
try {
|
||||
const r = await (await fetch('/api/my/pages/upload', { method: 'POST', headers: { 'Content-Type': file.type }, body: file })).json(); if (r.error) throw new Error(r.error);
|
||||
IMAGES.unshift(r.image); drawImages(); const f = $('f-image'); if (f) { f.value = r.image.url; f.dispatchEvent(new Event('input')); } toast('Uploaded. Save to keep it on the page.');
|
||||
} catch (e) { toast(e.message, true); }
|
||||
if (btn) { btn.disabled = false; btn.textContent = 'Upload image'; }
|
||||
}
|
||||
CR.mount({ active: 'pages', title: 'Pages', sub: 'loading', actions: '<button class="btn pri" type="button" id="newBtn">+ New page</button>' });
|
||||
const pageUrl = p => (BASE || ('https://' + (HOSTS[0] || location.host) + '/p/')) + p.slug;
|
||||
async function load(keepSel) {
|
||||
let r; try { r = await CR.get('/api/my/pages'); } catch (e) { CR.sub('could not load'); return; }
|
||||
PAGES = r.pages || []; HOSTS = r.hosts || []; BASE = r.pageBase || ''; if (r.styles) STYLES = r.styles;
|
||||
PAGES = r.pages || []; HOSTS = r.hosts || []; BASE = r.pageBase || ''; if (r.styles) STYLES = r.styles; PROVIDERS = r.providers || []; IMAGES = r.images || []; if (r.imageMax) IMG_MAX = r.imageMax; if (r.imageBytes) IMG_BYTES = r.imageBytes;
|
||||
const pubd = PAGES.filter(p => p.status === 'published').length;
|
||||
CR.sub(PAGES.length + ' page' + (PAGES.length === 1 ? '' : 's') + ' · ' + pubd + ' live');
|
||||
const views = PAGES.reduce((n, p) => n + p.views, 0), leads = PAGES.reduce((n, p) => n + p.leads, 0), clicks = PAGES.reduce((n, p) => n + p.clicks, 0);
|
||||
@@ -45,7 +81,13 @@
|
||||
$('edPublish').textContent = p.status === 'published' ? 'Unpublish' : 'Publish'; $('edPreview').href = '/p/' + p.slug + '?preview=1';
|
||||
$('edUrl').hidden = p.status !== 'published'; $('edUrl').textContent = pageUrl(p);
|
||||
const c = p.content || {}; const v = k => k === 'ctaText' ? (c.cta && c.cta.text) || '' : k === 'ctaUrl' ? (c.cta && c.cta.url) || '' : Array.isArray(c[k]) ? c[k].join('\n') : (c[k] == null ? '' : c[k]);
|
||||
$('edFields').innerHTML = F[p.type].map(([k, label, ta]) => '<label class="lbl">' + esc(label) + (ta ? '<textarea class="field" id="f-' + k + '">' + esc(v(k)) + '</textarea>' : '<input class="field' + (/Url|image/i.test(k) ? ' mono' : '') + '" id="f-' + k + '" value="' + esc(v(k)) + '">') + '</label>').join('');
|
||||
$('edFields').innerHTML = F[p.type].map(([k, label, ta]) => '<label class="lbl">' + esc(label) + (ta ? '<textarea class="field" id="f-' + k + '">' + esc(v(k)) + '</textarea>' : '<input class="field' + (/Url|image/i.test(k) ? ' mono' : '') + '" id="f-' + k + '" value="' + esc(v(k)) + '">') + '</label>'
|
||||
// hosted images: an Upload button beside the image field (this image is the hero on bridge/review and the card image on squeeze) + the member's strip
|
||||
+ (k === 'image' ? '<div class="imgrow"><button class="btn sm" type="button" id="imgUpload">Upload image</button><input type="file" id="imgFile" accept="image/png,image/jpeg,image/webp" hidden><span class="muted" style="font-size:11px">PNG, JPG or WebP up to 2 MB. Uploading fills the URL above.</span></div><div class="imgstrip" id="imgStrip"></div>' : '')
|
||||
// pasted provider forms: say at paste time which autoresponder the form posts to
|
||||
+ (k === 'formEmbed' ? '<div class="muted" id="providerNote" style="font-size:12px" hidden></div>' : '')).join('');
|
||||
if ($('imgUpload')) { $('imgUpload').addEventListener('click', () => $('imgFile').click()); $('imgFile').addEventListener('change', () => { uploadFile($('imgFile').files[0]); $('imgFile').value = ''; }); drawImages(); }
|
||||
if ($('f-formEmbed')) { const fe = $('f-formEmbed'); const upd = () => providerNote(fe.value); fe.addEventListener('input', upd); fe.addEventListener('paste', () => setTimeout(upd, 0)); upd(); }
|
||||
// the Look panel: niche preset, design, colours, layout. Each change saves at once and the gallery/preview refresh.
|
||||
const d = p.design || {}; const setLook = async patch => { try { await api('/api/my/pages/' + p.id, patch); load(true); } catch (e) { toast(e.message, true); } };
|
||||
const ns = $('niche'); ns.innerHTML = '<option value="">None (set it yourself)</option>' + STYLES.niches.map(n => '<option value="' + n.key + '"' + (d.niche === n.key ? ' selected' : '') + '>' + esc(n.label) + ' \u00b7 ' + esc(n.blurb) + '</option>').join(''); ns.onchange = () => setLook({ niche: ns.value });
|
||||
|
||||
@@ -32,6 +32,27 @@
|
||||
const best = (s.hours || []).map((n, i) => [n, i]).sort((a, b) => b[0] - a[0]).slice(0, 3).filter(x => x[0]).map(x => x[1] + ':00');
|
||||
$('hourNote').textContent = best.length ? 'Busiest hours (UTC): ' + best.join(', ') + '. Hour rules per link come next.' : 'No clicks yet.';
|
||||
$('convRows').innerHTML = kv(s.conversions || [], 0);
|
||||
// -- Pages and Zones (2026-10-10): one bar per Central day in the range (empty days are zero), totals, per-item table
|
||||
const dayBars = (barsId, axisId, rows, f, g, empty) => {
|
||||
const map = {}; (rows || []).forEach(r => { map[r.day] = r; });
|
||||
const ser = keys.map(k => ({ day: k, a: map[k] ? f(map[k]) : 0, b: map[k] ? g(map[k]) : 0 }));
|
||||
const max = Math.max(1, ...ser.map(x => Math.max(x.a, x.b))); const any = ser.some(x => x.a || x.b);
|
||||
const el = $(barsId); el.style.gridTemplateColumns = 'repeat(' + keys.length + ',minmax(0,1fr))'; el.classList.add('stack');
|
||||
el.innerHTML = ser.map(x => '<i class="' + (x.a ? '' : 'dim') + '" style="height:' + Math.round(x.a / max * 100) + '%" title="' + x.day + ' · ' + x.a + ' / ' + x.b + '">' + (x.b ? '<b style="height:' + Math.round(x.b / x.a * 100 || 0) + '%"></b>' : '') + '</i>').join('');
|
||||
$(axisId).innerHTML = any ? '<span>' + keys[0] + '</span><span>' + keys[Math.floor(keys.length / 2)] + '</span><span>' + keys[keys.length - 1] + '</span>' : '<span class="muted">' + empty + '</span>';
|
||||
};
|
||||
const mini = rows => rows.map(([k, v]) => '<div class="m"><span class="k">' + esc(k) + '</span><span class="v">' + v + '</span></div>').join('');
|
||||
const pg = s.pages || { byDay: [], byPage: [] };
|
||||
// bar = views, inner bar = leads (leads as a share of that day's views; a day with leads but no views still shows)
|
||||
dayBars('pgBars', 'pgAxis', pg.byDay, d => Math.max(d.views, d.leads), d => d.leads, 'no page views yet');
|
||||
$('pgBars').querySelectorAll('i b').forEach(b => { b.style.background = 'var(--sig)'; });
|
||||
$('pgTiles').innerHTML = mini([['Views', fmt(pg.views)], ['Unique', fmt(pg.uniques)], ['Clicks through', fmt(pg.clicks)], ['Leads', fmt(pg.leads)]]);
|
||||
$('pgRows').innerHTML = (pg.byPage || []).length ? pg.byPage.map(x => '<div class="rw"><a href="/pages" style="text-decoration:none;color:var(--ink)"><b>' + esc(x.title) + '</b><br><span class="mono muted" style="font-size:11px">' + esc(x.type) + ' · ' + (x.status === 'published' ? '<span class="ok">live</span>' : 'draft') + '</span></a><span class="r num">' + fmt(x.views) + '</span><span class="r num">' + fmt(x.uniques) + '</span><span class="r num">' + fmt(x.clicks) + '</span><span class="r num">' + fmt(x.leads) + '</span></div>').join('') : '<div class="rw"><span class="muted">No pages yet. <a href="/pages">Make one</a>.</span></div>';
|
||||
const zn = s.zones || { byDay: [], byZone: [] };
|
||||
// bar = all views, lighter inner share = the ones that were NOT viewable
|
||||
dayBars('znBars', 'znAxis', zn.byDay, d => d.views, d => d.views - d.viewable, 'no zone views yet');
|
||||
$('znTiles').innerHTML = mini([['Views', fmt(zn.views)], ['Viewable', fmt(zn.viewable) + (zn.views ? ' <small class="muted" style="font-size:11px">' + Math.round(zn.viewable / zn.views * 100) + '%</small>' : '')], ['Clicks', fmt(zn.clicks)], ['Credits earned', fmt(zn.credits)]]);
|
||||
$('znRows').innerHTML = (zn.byZone || []).length ? zn.byZone.map(x => '<div class="rw"><a href="/zones" style="text-decoration:none;color:var(--ink)"><b>' + esc(x.name) + '</b><br><span class="mono muted" style="font-size:11px">' + esc(x.site) + ' · ' + esc(x.size) + (x.paused ? ' · <span class="warn">paused</span>' : x.active ? '' : ' · off') + '</span></a><span class="r num">' + fmt(x.views) + '</span><span class="r num">' + fmt(x.viewable) + (x.viewablePct != null ? ' <span class="muted" style="font-size:10px">' + x.viewablePct + '%</span>' : '') + '</span><span class="r num">' + fmt(x.clicks) + '</span><span class="r num">' + fmt(x.credits) + '</span></div>').join('') : '<div class="rw"><span class="muted">No zones yet. <a href="/zones">Add one</a>.</span></div>';
|
||||
}
|
||||
CR.requireSession(load);
|
||||
})();
|
||||
|
||||
+4
-1
@@ -26,6 +26,9 @@
|
||||
.ed{display:grid;gap:10px} .ed textarea{min-height:90px;resize:vertical}
|
||||
.pal{display:flex;gap:6px} .pal button{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer} .pal button.on{border-color:var(--ink)}
|
||||
.leads .rw{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) 110px}
|
||||
.imgrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:-4px 0 0}
|
||||
.imgstrip{display:flex;gap:6px;flex-wrap:wrap;align-items:flex-start;min-height:12px}.imgstrip .im{position:relative;width:64px;height:48px;border:1px solid var(--line);border-radius:7px;overflow:hidden;cursor:pointer;background:var(--panel-2);display:block}.imgstrip .im img{width:100%;height:100%;object-fit:cover;display:block}.imgstrip .im:hover{border-color:var(--accent)}
|
||||
.imgstrip .x{position:absolute;top:2px;right:2px;width:18px;height:18px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;font:700 13px/18px var(--body);padding:0;cursor:pointer}.imgstrip .x:hover{background:var(--bad,#c0392b)}
|
||||
@media (max-width:900px){.ws{grid-template-columns:1fr}.side{border-left:0;border-top:1px solid var(--line)}.body{padding:12px 16px}.types{grid-template-columns:1fr}}
|
||||
</style>
|
||||
</head>
|
||||
@@ -70,6 +73,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261008c"></script>
|
||||
<script src="/assets/pages-screen.js?v=20261008b"></script>
|
||||
<script src="/assets/pages-screen.js?v=20261010a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+27
-2
@@ -14,7 +14,12 @@
|
||||
.kv{display:grid;grid-template-columns:minmax(0,1fr) 60px 70px;gap:8px;font-size:12px;align-items:center}
|
||||
.range{display:flex;border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;background:var(--panel-2)} .range button{background:transparent;border:0;color:var(--muted);font-family:var(--mono);font-size:12px;padding:5px 10px;cursor:pointer} .range button.on{background:var(--ink);color:#fff}
|
||||
.top .hd,.top .rw{grid-template-columns:minmax(0,1fr) 80px 80px 80px}
|
||||
@media (max-width:900px){.two,.grid2{grid-template-columns:1fr}.body{padding:12px 16px}}
|
||||
.sect{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
|
||||
.ph{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}.legend{display:flex;gap:14px;font-size:11px;color:var(--ink-2)}.legend i{display:inline-block;width:10px;height:10px;vertical-align:middle;margin-right:5px}
|
||||
.bars.stack i{position:relative}.bars.stack i b{position:absolute;left:0;right:0;bottom:0;display:block;background:var(--line);border-radius:2px 2px 0 0}.bars i.ghost{background:var(--line)}
|
||||
.mini{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.mini .m{background:var(--panel-2);border:1px solid var(--line);border-radius:6px;padding:8px 10px;display:grid;gap:2px}.mini .m .k{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.mini .m .v{font-family:var(--display);font-weight:700;font-size:20px;color:var(--ink);font-variant-numeric:tabular-nums}
|
||||
.pages .hd,.pages .rw,.zones .hd,.zones .rw{grid-template-columns:minmax(0,1fr) 60px 60px 60px 60px;gap:8px}
|
||||
@media (max-width:900px){.two,.grid2,.sect{grid-template-columns:1fr}.body{padding:12px 16px}.mini{grid-template-columns:repeat(2,minmax(0,1fr))}.pages .hd,.pages .rw,.zones .hd,.zones .rw{grid-template-columns:minmax(0,1fr) 48px 48px 48px 48px;gap:6px;padding:10px 12px;font-size:12px}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -36,9 +41,29 @@
|
||||
<div class="panel"><h2>Conversions</h2><div class="kv" id="convRows"></div><div class="muted">Joins, wallets and purchases matched to a click on one of your links, plus anything a partner reported by postback.</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Pages: views, uniques, clicks through and leads on the member's bridge / review / squeeze pages (2026-10-10) -->
|
||||
<div class="sec">Pages</div>
|
||||
<div class="two sect">
|
||||
<div class="panel">
|
||||
<div class="ph"><h2>Page views by day</h2><div class="legend"><span><i style="background:var(--accent)"></i>views</span><span><i style="background:var(--sig)"></i>leads</span></div></div>
|
||||
<div class="bars" id="pgBars" style="height:150px"></div><div class="axis" id="pgAxis"></div>
|
||||
<div class="mini" id="pgTiles"></div>
|
||||
</div>
|
||||
<div class="panel"><h2>By page</h2><div class="tbl pages"><div class="hd"><span>Page</span><span class="r">Views</span><span class="r">Unique</span><span class="r">Clicks</span><span class="r">Leads</span></div><div id="pgRows"></div></div><div class="muted" style="margin-top:8px">Views exclude bots. Clicks are people who pressed the button on the page. Leads came in through the page's own form. <a href="/pages">Open Pages</a></div></div>
|
||||
</div>
|
||||
<!-- Zones: ad-slot impressions on the member's own sites and the credits they earned (2026-10-10) -->
|
||||
<div class="sec">Zones</div>
|
||||
<div class="two sect">
|
||||
<div class="panel">
|
||||
<div class="ph"><h2>Zone views by day</h2><div class="legend"><span><i style="background:var(--accent)"></i>viewable</span><span><i style="background:var(--line)"></i>not seen</span></div></div>
|
||||
<div class="bars" id="znBars" style="height:150px"></div><div class="axis" id="znAxis"></div>
|
||||
<div class="mini" id="znTiles"></div>
|
||||
</div>
|
||||
<div class="panel"><h2>By zone</h2><div class="tbl zones"><div class="hd"><span>Zone</span><span class="r">Views</span><span class="r">Viewable</span><span class="r">Clicks</span><span class="r">Credits</span></div><div id="znRows"></div></div><div class="muted" style="margin-top:8px">A view counts when the tag loads; viewable means at least half the banner was on screen for a second. Credits are the zone's all-time earnings. <a href="/zones">Open Zones</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261008c"></script>
|
||||
<script src="/assets/reports.js?v=20260929c"></script>
|
||||
<script src="/assets/reports.js?v=20261010a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user