273 lines
21 KiB
HTML
Executable File
273 lines
21 KiB
HTML
Executable File
<!-- WEVADS UNIVERSAL DRILL-DOWN v2 -->
|
|
<div id="uDrill" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.88);z-index:10000;overflow-y:auto;padding:30px 20px">
|
|
<div style="max-width:1000px;margin:0 auto;background:#0c1220;border:1px solid #1e293b;border-radius:12px;padding:20px;box-shadow:0 25px 50px rgba(0,0,0,.5)">
|
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
|
|
<h2 id="uDT" style="color:#22d3ee;font-size:16px;font-family:'DM Sans',sans-serif;margin:0">🔍 Drill Down</h2>
|
|
<div style="display:flex;gap:8px;align-items:center">
|
|
<input id="uDQ" placeholder="Recherche universelle..." style="width:220px;padding:6px 12px;background:#060a14;border:1px solid #1e293b;border-radius:6px;color:#e2e8f0;font-size:11px;font-family:'DM Sans',sans-serif" onkeyup="if(event.key==='Enter')uSearch()">
|
|
<button onclick="uSearch()" style="padding:6px 12px;background:rgba(34,211,238,.15);border:1px solid #22d3ee;border-radius:6px;color:#22d3ee;cursor:pointer;font-size:10px;font-weight:600">Search</button>
|
|
<button onclick="document.getElementById('uDrill').style.display='none'" style="background:none;border:1px solid #1e293b;border-radius:6px;padding:6px 10px;color:#e2e8f0;font-size:16px;cursor:pointer;line-height:1">×</button>
|
|
</div></div>
|
|
<div id="uDB" style="color:#e2e8f0;font-size:12px;font-family:'DM Sans',sans-serif;max-height:70vh;overflow-y:auto"></div>
|
|
<div id="uDP" style="margin-top:10px;text-align:center"></div>
|
|
</div></div>
|
|
<script>
|
|
(function(){
|
|
var API='/api/universal-drill.php';
|
|
var TH='text-align:left;padding:6px 8px;color:#64748b;font-size:9px;text-transform:uppercase;border-bottom:1px solid #1e293b';
|
|
var TD='padding:6px 8px;border-bottom:1px solid rgba(30,41,59,.3);font-size:11px';
|
|
var CY='color:#22d3ee';var GN='color:#34d399';var AM='color:#fbbf24';var RD='color:#f87171';var PK='color:#f472b6';var BL='color:#60a5fa';
|
|
function show(){document.getElementById('uDrill').style.display='block'}
|
|
function setT(t){document.getElementById('uDT').innerHTML=t}
|
|
function setB(h){document.getElementById('uDB').innerHTML=h}
|
|
function nt(s,c){return '<span style="display:inline-block;padding:2px 6px;border-radius:4px;font-size:9px;font-weight:600;background:rgba('+(c==='g'?'52,211,153':c==='r'?'248,113,113':c==='a'?'251,191,36':c==='b'?'96,165,250':'167,139,250')+',.15);color:var(--'+(c==='g'?'gn':c==='r'?'rd':c==='a'?'am':c==='b'?'bl':'pu')+',#'+(c==='g'?'34d399':c==='r'?'f87171':c==='a'?'fbbf24':c==='b'?'60a5fa':'a78bfa')+')">'+s+'</span>'}
|
|
function stBadge(s){s=(s||'').toLowerCase();return s==='active'||s==='verified'||s==='inbox'?nt(s,'g'):s==='disabled'||s==='suspended'||s==='blocked'||s==='spam'||s==='hard'?nt(s,'r'):s==='warming'||s==='pending'?nt(s,'a'):nt(s,'b')}
|
|
function pager(action,page,pages,extra){
|
|
var h='';var args=extra||'';
|
|
if(page>1) h+='<button onclick="'+action+'('+(page-1)+',\''+args+'\')" style="margin:4px;padding:4px 14px;background:#1e293b;border:1px solid #2d3748;color:#e2e8f0;border-radius:4px;cursor:pointer;font-size:11px">← Prev</button>';
|
|
h+='<span style="color:#64748b;font-size:11px;margin:0 8px">Page '+page+'/'+Math.min(pages,999)+'</span>';
|
|
if(page<pages) h+='<button onclick="'+action+'('+(page+1)+',\''+args+'\')" style="margin:4px;padding:4px 14px;background:#1e293b;border:1px solid #2d3748;color:#e2e8f0;border-radius:4px;cursor:pointer;font-size:11px">Next →</button>';
|
|
document.getElementById('uDP').innerHTML=h;
|
|
}
|
|
function tbl(headers,rows,renderRow){
|
|
var h='<table style="width:100%;border-collapse:collapse"><tr>';
|
|
headers.forEach(function(hd){h+='<th style="'+TH+'">'+hd+'</th>'});
|
|
h+='</tr>';rows.forEach(function(r){h+=renderRow(r)});
|
|
return h+'</table>';
|
|
}
|
|
function fmt(n){return (n||0).toLocaleString()}
|
|
|
|
// === DRILL ISP (contacts) ===
|
|
window.drillISP=function(isp,pg){
|
|
pg=pg||1;show();setT('📧 ISP: <b style="'+CY+'">'+isp+'</b>');setB('Loading...');
|
|
fetch(API+'?action=drill_isp&isp='+encodeURIComponent(isp)+'&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+CY+'">'+fmt(d.total)+' contacts</div>'+
|
|
tbl(['Email','Name','Status','Source'],d.contacts||[],function(c){
|
|
return '<tr><td style="'+TD+';'+CY+'">'+c.email+'</td><td style="'+TD+'">'+(c.first_name||'-')+'</td><td style="'+TD+'">'+stBadge(c.status)+'</td><td style="'+TD+'">'+(c.source||'-')+'</td></tr>';
|
|
}));
|
|
pager('_dI',d.page,d.pages,isp);
|
|
}).catch(function(e){setB('Error: '+e)});
|
|
};
|
|
window._dI=function(pg,isp){drillISP(isp,pg)};
|
|
|
|
// === DRILL OFFERS ===
|
|
window.drillOffers=function(pg){
|
|
pg=pg||1;show();setT('💰 Offers');setB('Loading...');
|
|
fetch(API+'?action=drill_offers&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+AM+'">'+fmt(d.total)+' offers</div>'+
|
|
tbl(['#','Name','Status','Payout','Network','Country'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b style="cursor:pointer;'+CY+';text-decoration:underline" onclick="drillOffer('+r.id+')">'+r.name+'</b></td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+';'+GN+';font-weight:700">$'+(r.payout||0)+'</td><td style="'+TD+'">'+(r.network||'-')+'</td><td style="'+TD+'">'+(r.country||'-')+'</td></tr>';
|
|
}));
|
|
pager('drillOffers',d.page,d.pages);
|
|
});
|
|
};
|
|
window.drillOffer=function(id){
|
|
show();setT('💰 Offer #'+id);setB('Loading...');
|
|
fetch(API+'?action=drill_offer&id='+id).then(r=>r.json()).then(function(d){
|
|
var o=d.offer||{};
|
|
var h='<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px"><div style="background:#111827;border:1px solid #1e293b;border-radius:8px;padding:12px"><b>'+o.name+'</b><br><span style="'+GN+'">$'+(o.payout||0)+'</span> — '+(o.network||'-')+' — '+(o.country||'-')+'<br>Status: '+stBadge(o.status)+'</div>';
|
|
h+='<div style="background:#111827;border:1px solid #1e293b;border-radius:8px;padding:12px">Creatives: <b style="'+PK+'">'+((d.creatives||[]).length)+'</b><br>Configs: <b style="'+BL+'">'+((d.configs||[]).length)+'</b></div></div>';
|
|
if((d.creatives||[]).length){
|
|
h+='<h3 style="color:#f472b6;font-size:12px;margin-bottom:8px">🎨 Creatives</h3>'+
|
|
tbl(['#','Name','Subject','Score','Status','O','C','Conv'],d.creatives,function(c){
|
|
return '<tr><td style="'+TD+'">'+c.id+'</td><td style="'+TD+'">'+c.creative_name+'</td><td style="'+TD+';max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+(c.subject_line||'-')+'</td><td style="'+TD+';'+GN+';font-weight:700">'+(c.score||0)+'</td><td style="'+TD+'">'+stBadge(c.status)+'</td><td style="'+TD+'">'+(c.opens||0)+'</td><td style="'+TD+'">'+(c.clicks||0)+'</td><td style="'+TD+';'+AM+'">'+(c.conversions||0)+'</td></tr>';
|
|
});
|
|
}
|
|
setB(h);document.getElementById('uDP').innerHTML='';
|
|
});
|
|
};
|
|
|
|
// === DRILL CREATIVES ===
|
|
window.drillCreatives=function(pg,status){
|
|
pg=pg||1;show();setT('🎨 Creatives'+(status?' ('+status+')':''));setB('Loading...');
|
|
fetch(API+'?action=drill_creatives&page='+pg+(status?'&status='+status:'')).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+PK+'">'+fmt(d.total)+' creatives</div>'+
|
|
tbl(['#','Name','Subject','Offer','Score','Status','Winner'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'">'+r.creative_name+'</td><td style="'+TD+';max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+(r.subject_line||'-')+'</td><td style="'+TD+';color:#64748b">'+(r.offer||'-')+'</td><td style="'+TD+';'+GN+';font-weight:700">'+(r.score||0)+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+'">'+(r.is_winner?'⭐':'')+'</td></tr>';
|
|
}));
|
|
pager('_dCr',d.page,d.pages,status||'');
|
|
});
|
|
};
|
|
window._dCr=function(pg,s){drillCreatives(pg,s)};
|
|
|
|
// === DRILL OFFICE ===
|
|
window.drillOffice=function(pg,status){
|
|
pg=pg||1;show();setT('🏢 Office Accounts'+(status?' ('+status+')':''));setB('Loading...');
|
|
fetch(API+'?action=drill_office&page='+pg+(status?'&status='+status:'')).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+BL+'">'+fmt(d.total)+' accounts</div>'+
|
|
tbl(['#','Name','Tenant','Status','Step','Exchange','Domains'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b>'+r.name+'</b></td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.tenant_domain||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+'">'+(r.current_step||0)+'/8</td><td style="'+TD+'">'+(r.exchange_configured?'✅':'❌')+'</td><td style="'+TD+'">'+(r.domains_count||0)+'</td></tr>';
|
|
}));
|
|
pager('_dOf',d.page,d.pages,status||'');
|
|
});
|
|
};
|
|
window._dOf=function(pg,s){drillOffice(pg,s)};
|
|
|
|
// === DRILL CONFIGS ===
|
|
window.drillConfigs=function(pg,filter){
|
|
pg=pg||1;show();setT('⚡ Brain Configs'+(filter?' ('+filter+')':''));setB('Loading...');
|
|
fetch(API+'?action=drill_configs&page='+pg+(filter?'&filter='+filter:'')).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+AM+'">'+fmt(d.total)+' configs</div>'+
|
|
tbl(['#','Name','Method','ISP','Status','Winner','Score','Sent','Inbox%'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b>'+(r.config_name||'-')+'</b></td><td style="'+TD+'">'+(r.send_method||'-')+'</td><td style="'+TD+';'+CY+'">'+(r.isp_target||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+'">'+(r.is_winner?'🏆':'')+'</td><td style="'+TD+';'+GN+'">'+(r.score||0)+'</td><td style="'+TD+'">'+fmt(r.total_sent)+'</td><td style="'+TD+'">'+(r.inbox_rate||0)+'%</td></tr>';
|
|
}));
|
|
pager('_dCf',d.page,d.pages,filter||'');
|
|
});
|
|
};
|
|
window._dCf=function(pg,f){drillConfigs(pg,f)};
|
|
|
|
// === DRILL WARMUP ===
|
|
window.drillWarmup=function(pg){
|
|
pg=pg||1;show();setT('🔥 Warmup Accounts');setB('Loading...');
|
|
fetch(API+'?action=drill_warmup&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+AM+'">'+fmt(d.total)+' warming</div>'+
|
|
tbl(['#','Email','Status','Day','Daily Vol','Created'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+';'+CY+'">'+(r.email||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+'">'+(r.current_day||0)+'</td><td style="'+TD+'">'+(r.daily_volume||0)+'</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.created_at||'').substring(0,10)+'</td></tr>';
|
|
}));
|
|
pager('drillWarmup',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === DRILL SENDS ===
|
|
window.drillSends=function(pg){
|
|
pg=pg||1;show();setT('📤 Send Log');setB('Loading...');
|
|
fetch(API+'?action=drill_sends&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px">'+fmt(d.total)+' sends</div>'+
|
|
tbl(['#','Recipient','ISP','Method','From','Subject','Status','Date'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+';'+CY+'">'+(r.recipient||'-')+'</td><td style="'+TD+'">'+(r.isp||'-')+'</td><td style="'+TD+'">'+(r.send_method||'-')+'</td><td style="'+TD+';font-size:10px">'+(r.from_email||'-')+'</td><td style="'+TD+';max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+(r.subject||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.created_at||'').substring(0,16)+'</td></tr>';
|
|
}));
|
|
pager('drillSends',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === DRILL DOMAINS ===
|
|
window.drillDomains=function(pg,dtype){
|
|
pg=pg||1;dtype=dtype||'office';show();setT('🌐 Domains ('+dtype+')');setB('Loading...');
|
|
fetch(API+'?action=drill_domains&dtype='+dtype+'&page='+pg).then(r=>r.json()).then(function(d){
|
|
var heads=dtype==='ptr'?['#','IP','PTR Domain','Hostname','Status','Inbox%','Sent']:dtype==='office'?['#','Domain','Status','Account']:['#','Domain/User','Status'];
|
|
setB('<div style="margin-bottom:8px;'+BL+'">'+fmt(d.total)+' '+dtype+' domains</div>'+
|
|
tbl(heads,d.rows||[],function(r){
|
|
if(dtype==='ptr') return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+';font-family:monospace">'+r.ip_address+'</td><td style="'+TD+';'+CY+'">'+(r.ptr_domain||'-')+'</td><td style="'+TD+'">'+(r.ptr_hostname||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+';'+GN+'">'+(r.inbox_rate||0)+'%</td><td style="'+TD+'">'+fmt(r.total_sent)+'</td></tr>';
|
|
if(dtype==='office') return '<tr><td style="'+TD+'">'+(r.id||'')+'</td><td style="'+TD+';'+CY+'"><b>'+(r.domain_name||'')+'</b></td><td style="'+TD+'">'+stBadge(r.verification_status||r.status)+'</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.account||'')+'</td></tr>';
|
|
return '<tr><td style="'+TD+'">'+(r.id||'')+'</td><td style="'+TD+';'+CY+'">'+(r.domain_name||r.username||'')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td></tr>';
|
|
}));
|
|
pager('_dDm',d.page,d.pages,dtype);
|
|
});
|
|
};
|
|
window._dDm=function(pg,t){drillDomains(pg,t)};
|
|
|
|
// === DRILL BOUNCES ===
|
|
window.drillBounces=function(pg){
|
|
pg=pg||1;show();setT('🛡️ Bounces');setB('Loading...');
|
|
fetch(API+'?action=drill_bounces&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+RD+'">'+fmt(d.total)+' bounces</div>'+
|
|
tbl(['#','Recipient','ISP','Type','Code','Message','Date'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+';'+CY+'">'+(r.recipient||'-')+'</td><td style="'+TD+'">'+(r.isp||'-')+'</td><td style="'+TD+'">'+stBadge(r.bounce_type)+'</td><td style="'+TD+'">'+(r.smtp_code||'-')+'</td><td style="'+TD+';max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b">'+(r.smtp_message||'-')+'</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.bounced_at||'').substring(0,16)+'</td></tr>';
|
|
}));
|
|
pager('drillBounces',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === DRILL CONVERSIONS ===
|
|
window.drillConversions=function(pg){
|
|
pg=pg||1;show();setT('💰 Conversions');setB('Loading...');
|
|
fetch(API+'?action=drill_conversions&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+GN+'">'+fmt(d.total)+' conversions</div>'+
|
|
tbl(['#','Sub1','Sub2','Sub3','Payout','Source','Date'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'">'+(r.sub1||'-')+'</td><td style="'+TD+'">'+(r.sub2||'-')+'</td><td style="'+TD+'">'+(r.sub3||'-')+'</td><td style="'+TD+';'+GN+';font-weight:700">$'+(r.payout||0)+'</td><td style="'+TD+'">'+(r.source||'-')+'</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.created_at||'').substring(0,16)+'</td></tr>';
|
|
}));
|
|
pager('drillConversions',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === DRILL PERSONAS ===
|
|
window.drillPersonas=function(pg){
|
|
pg=pg||1;show();setT('🎭 Personas');setB('Loading...');
|
|
fetch(API+'?action=drill_personas&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+PK+'">'+fmt(d.total)+' personas</div>'+
|
|
tbl(['#','Name','Email','Country','Gender','Status'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b>'+(r.first_name||'')+' '+(r.last_name||'')+'</b></td><td style="'+TD+';'+CY+'">'+(r.email||'-')+'</td><td style="'+TD+'">'+(r.country||'-')+'</td><td style="'+TD+'">'+(r.gender||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td></tr>';
|
|
}));
|
|
pager('drillPersonas',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === DRILL SEEDS ===
|
|
window.drillSeeds=function(pg){
|
|
pg=pg||1;show();setT('🌱 Seeds');setB('Loading...');
|
|
fetch(API+'?action=drill_seeds&page='+pg).then(r=>r.json()).then(function(d){
|
|
setB('<div style="margin-bottom:8px;'+AM+'">'+fmt(d.total)+' seeds</div>'+
|
|
tbl(['#','Email','ISP','Status','Inbox%','Last Check'],d.rows||[],function(r){
|
|
return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+';'+CY+'">'+(r.email||'-')+'</td><td style="'+TD+'">'+(r.isp||'-')+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+';'+GN+'">'+(r.inbox_rate||0)+'%</td><td style="'+TD+';color:#64748b;font-size:10px">'+(r.last_check||'-')+'</td></tr>';
|
|
}));
|
|
pager('drillSeeds',d.page,d.pages);
|
|
});
|
|
};
|
|
|
|
// === UNIVERSAL SEARCH ===
|
|
window.uSearch=function(){
|
|
var q=document.getElementById('uDQ').value;if(!q)return;
|
|
show();setT('🔍 Search: <b>'+q+'</b>');setB('Searching...');
|
|
fetch(API+'?action=search&q='+encodeURIComponent(q)).then(r=>r.json()).then(function(d){
|
|
var res=d.results||{};var h='';
|
|
if(res.contacts&&res.contacts.length){h+='<h3 style="color:#22d3ee;font-size:12px;margin:10px 0 6px">📧 Contacts ('+res.contacts.length+')</h3>'+tbl(['Email','ISP','Status'],res.contacts,function(r){return '<tr><td style="'+TD+';'+CY+'">'+r.email+'</td><td style="'+TD+'">'+r.isp+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td></tr>'});}
|
|
if(res.offers&&res.offers.length){h+='<h3 style="color:#fbbf24;font-size:12px;margin:10px 0 6px">💰 Offers ('+res.offers.length+')</h3>'+tbl(['#','Name','Status','Payout'],res.offers,function(r){return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b style="cursor:pointer;'+CY+'" onclick="drillOffer('+r.id+')">'+r.name+'</b></td><td style="'+TD+'">'+stBadge(r.status)+'</td><td style="'+TD+';'+GN+'">$'+r.payout+'</td></tr>'});}
|
|
if(res.accounts&&res.accounts.length){h+='<h3 style="color:#60a5fa;font-size:12px;margin:10px 0 6px">🏢 Accounts ('+res.accounts.length+')</h3>'+tbl(['#','Name','Tenant','Status'],res.accounts,function(r){return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'"><b>'+r.name+'</b></td><td style="'+TD+'">'+r.tenant_domain+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td></tr>'});}
|
|
if(res.domains&&res.domains.length){h+='<h3 style="color:#f59e0b;font-size:12px;margin:10px 0 6px">🌐 Domains ('+res.domains.length+')</h3>'+tbl(['Domain','Status'],res.domains,function(r){return '<tr><td style="'+TD+';'+CY+'">'+r.domain_name+'</td><td style="'+TD+'">'+stBadge(r.verification_status)+'</td></tr>'});}
|
|
if(res.creatives&&res.creatives.length){h+='<h3 style="color:#f472b6;font-size:12px;margin:10px 0 6px">🎨 Creatives ('+res.creatives.length+')</h3>'+tbl(['#','Name','Subject','Status'],res.creatives,function(r){return '<tr><td style="'+TD+'">'+r.id+'</td><td style="'+TD+'">'+r.creative_name+'</td><td style="'+TD+'">'+r.subject_line+'</td><td style="'+TD+'">'+stBadge(r.status)+'</td></tr>'});}
|
|
if(!h) h='<div style="text-align:center;color:#64748b;padding:20px">No results for "'+q+'"</div>';
|
|
setB(h);document.getElementById('uDP').innerHTML='';
|
|
});
|
|
};
|
|
|
|
// === AUTO-DETECT DRILLABLE ELEMENTS ===
|
|
function autoWire(){
|
|
// ISP names in tables
|
|
var isps=['gmail','hotmail','spectrum','t-online','gmx','web.de','videotron','yahoo','aol','orange','free','sfr','comcast','outlook','live','msn','laposte','wanadoo','numericable','cox','att','verizon','charter'];
|
|
document.querySelectorAll('td,span.n,div').forEach(function(el){
|
|
var t=(el.textContent||'').trim().toLowerCase();
|
|
// ISP drill
|
|
if(isps.indexOf(t)!==-1 && !el.dataset.wired){
|
|
el.dataset.wired='1';el.style.cursor='pointer';el.style.color='#22d3ee';el.style.textDecoration='underline';
|
|
el.onclick=function(e){e.stopPropagation();drillISP(t)};
|
|
}
|
|
});
|
|
// Numbers that look like KPIs - make stat cards clickable
|
|
document.querySelectorAll('.sc,.funnel-step,.pipe-step').forEach(function(card){
|
|
if(card.dataset.wired) return; card.dataset.wired='1';
|
|
var label=(card.querySelector('.l')||{}).textContent||'';label=label.toLowerCase();
|
|
var fn=null;
|
|
if(label.match(/warming|warmup/)) fn=function(){drillWarmup()};
|
|
else if(label.match(/seed/)) fn=function(){drillSeeds()};
|
|
else if(label.match(/contact/)) fn=function(){drillISP('gmail')};
|
|
else if(label.match(/offer/)) fn=function(){drillOffers()};
|
|
else if(label.match(/creative/)) fn=function(){drillCreatives()};
|
|
else if(label.match(/config/)) fn=function(){drillConfigs()};
|
|
else if(label.match(/winner/)) fn=function(){drillConfigs(1,'winner')};
|
|
else if(label.match(/active\s*(config|brain)/i)) fn=function(){drillConfigs(1,'active')};
|
|
else if(label.match(/office|o365|tenant/)) fn=function(){drillOffice()};
|
|
else if(label.match(/domain/)) fn=function(){drillDomains()};
|
|
else if(label.match(/bounce/)) fn=function(){drillBounces()};
|
|
else if(label.match(/conver/)) fn=function(){drillConversions()};
|
|
else if(label.match(/persona/)) fn=function(){drillPersonas()};
|
|
else if(label.match(/send|sent|capacity/)) fn=function(){drillSends()};
|
|
else if(label.match(/graph/)) fn=function(){window.drillGraphSends?drillGraphSends():drillSends()};
|
|
else if(label.match(/ptr/)) fn=function(){drillDomains(1,'ptr')};
|
|
else if(label.match(/cloudflare|cf\b/)) fn=function(){drillDomains(1,'cloudflare')};
|
|
else if(label.match(/freedns/)) fn=function(){drillDomains(1,'freedns')};
|
|
else if(label.match(/inbox/)) fn=function(){window.drillInbox?drillInbox():drillSeeds()};
|
|
if(fn){card.style.cursor='pointer';card.title='Click to drill down';card.addEventListener('click',fn);
|
|
card.style.transition='border-color .2s';card.addEventListener('mouseenter',function(){this.style.borderColor='#22d3ee'});
|
|
card.addEventListener('mouseleave',function(){this.style.borderColor=''});
|
|
}
|
|
});
|
|
}
|
|
// Wire on load + on tab switch
|
|
setTimeout(autoWire,600);
|
|
setTimeout(autoWire,2000);
|
|
document.addEventListener('click',function(){setTimeout(autoWire,500)});
|
|
// Keyboard shortcut: Ctrl+K for universal search
|
|
document.addEventListener('keydown',function(e){if((e.ctrlKey||e.metaKey)&&e.key==='k'){e.preventDefault();show();document.getElementById('uDQ').focus()}});
|
|
})();
|
|
</script>
|