Files
Marty Bostick 001878bdae ViralAdBlitz v1 (viraladblitz.com rebuild, Marty approved 2026-11-14): the network's text-ad home, local build, not deployed
- Free text ad for network members (InstantAdPay / LinkSpin sign-in or wallet, membership through the hub), one per member
- Member pages viraladblitz.com/<username>: own ad + the first 5 people above in the hub line with a live ad (by place) + 2 Boosted places
- Front page: amber ticker (Boosted starred), Top ads this week by verified clicks, today's numbers, ledger, contract proof
- Verified visitors / views / clicks (ticket + dwell + per-visitor dedupe + per-connection cap + bot filter, owner excluded)
- Boost $5 = 500 guaranteed views through VABShop: keeper-signed EIP-712 line voucher from the hub line, watcher, delivery
  counted per verified view with an audit row each, Network Ad Space text-ad finishing after 30 days (vabnas.js)
- Trust pack: /ledger, /contract, toasts, Telegram card per Boost (once), Terms / Earnings Disclaimer / Privacy (TrustClickz),
  network footer from the hub with tracked links, promo kit (21 creatives) + /promote, LinkSpin zone placeholders, hub report
- Old YFW links via the oldrefs map (admin load route); docstore MySQL documents + row tables
- qa/smoke.mjs 162/162 (stand-in hub, chain, Telegram, NAS; Playwright desktop + phone), qa/chain.mjs 20/20 (real VABShop on anvil)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:52:03 -06:00

20 lines
2.0 KiB
JavaScript

// Admin: status, Boost delivery, member lookup, ad status, the old-link map. The token stays in this tab only (sessionStorage).
(function () {
VAB.renderNav(''); VAB.renderFooter();
const $ = VAB.$, esc = VAB.esc;
let tok = ''; try { tok = sessionStorage.getItem('vab.admin') || ''; } catch (e) {}
const H = () => ({ 'x-admin-token': tok, 'Content-Type': 'application/json' });
const show = (el, o) => { el.textContent = JSON.stringify(o, null, 2); };
async function load() {
if (!tok) return;
const s = await VAB.getJSON('/api/admin/status', { headers: H() }); show($('statusOut'), s);
const b = await VAB.getJSON('/api/admin/boosts', { headers: H() });
$('boostRows').querySelector('tbody').innerHTML = (b.boosts || []).map(x => '<tr><td>' + VAB.when(x.at) + '</td><td>ad #' + esc(x.adId) + '</td><td>' + VAB.n(x.delivered) + ' / ' + VAB.n(x.views) + '</td><td>' + esc(x.status) + '</td><td class="mono small">' + esc(VAB.short(x.buyer)) + '</td></tr>').join('') || '<tr><td class="muted">none</td></tr>';
}
$('tokForm').addEventListener('submit', e => { e.preventDefault(); tok = $('tok').value.trim(); try { sessionStorage.setItem('vab.admin', tok); } catch (x) {} load(); });
$('lookForm').addEventListener('submit', async e => { e.preventDefault(); show($('lookOut'), await VAB.getJSON('/api/admin/member-lookup?q=' + encodeURIComponent($('look').value.trim()), { headers: H() })); });
$('adForm').addEventListener('submit', async e => { e.preventDefault(); const r = await VAB.getJSON('/api/admin/ad', { method: 'POST', headers: H(), body: JSON.stringify({ id: Number($('adId').value), status: $('adStatus').value.trim(), note: $('adNoteIn').value }) }); VAB.status(r.error || 'Saved.', r.error ? 'err' : 'ok'); });
$('oldFile').addEventListener('change', async e => { const f = e.target.files[0]; if (!f) return; const r = await fetch('/api/admin/oldrefs', { method: 'POST', headers: H(), body: await f.text() }); show($('oldOut'), await r.json()); });
load();
})();