Files
html/office-365-dashboard-live.html
opus d5edaa769c
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
auto-sync via WEVIA git_sync_all intent 2026-04-21T14:56:43+02:00
2026-04-21 14:56:43 +02:00

179 lines
9.9 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Office 365 Live Dashboard — WEVAL</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#0a0e27;color:#e4e8f7;margin:0;padding:20px;min-height:100vh}
.container{max-width:1400px;margin:0 auto}
h1{background:linear-gradient(90deg,#0078D4,#00a4ef);-webkit-background-clip:text;-webkit-text-fill-color:transparent;margin-bottom:4px;font-size:36px}
.subtitle{color:#9ca8d3;margin-bottom:24px;font-size:14px}
.live-pulse{display:inline-block;width:8px;height:8px;background:#10b981;border-radius:50%;animation:pulse 2s infinite;margin-right:6px}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}
.card{background:linear-gradient(135deg,rgba(0,120,212,0.2),rgba(20,25,51,0.8));border:1px solid #0078D4;border-radius:12px;padding:20px;transition:transform 0.2s}
.card:hover{transform:translateY(-2px);border-color:#00a4ef}
.card h3{color:#9ca8d3;margin:0 0 12px;font-size:12px;text-transform:uppercase;font-weight:600;letter-spacing:0.5px}
.big{font-size:36px;font-weight:800;color:#00a4ef}
.sub{color:#9ca8d3;font-size:12px;margin-top:4px}
.status-badge{display:inline-block;padding:4px 10px;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase}
.st-active{background:#10b981;color:#fff}
.st-pending{background:#f59e0b;color:#000}
.st-warming{background:#6366f1;color:#fff}
.st-blocked{background:#ef4444;color:#fff}
table{width:100%;border-collapse:collapse;background:rgba(20,25,51,0.5);border-radius:12px;overflow:hidden}
th{background:#0078D4;color:#fff;font-size:11px;text-transform:uppercase;padding:12px;text-align:left}
td{padding:14px 12px;border-bottom:1px solid rgba(38,49,97,0.5);font-size:13px}
tr:hover{background:rgba(0,120,212,0.05)}
.health-bar{width:100%;height:8px;background:#1e2549;border-radius:4px;overflow:hidden;margin-top:8px}
.health-bar-fill{height:100%;background:linear-gradient(90deg,#ef4444,#f59e0b,#10b981);transition:width 0.5s}
</style>
</head>
<body>
<div class="container">
<h1>Office 365 Dashboard</h1>
<div class="subtitle">
<span class="live-pulse"></span> Live data <code>/api/office-admins.php</code> — auto-refresh 30s
</div>
<div class="grid">
<div class="card"><h3>Total Accounts</h3><div class="big" id="total"></div><div class="sub">Dans tous les tenants</div></div>
<div class="card"><h3>Active</h3><div class="big" id="active" style="color:#10b981"></div><div class="sub" id="active-pct"></div></div>
<div class="card"><h3>Pending</h3><div class="big" id="pending" style="color:#f59e0b"></div><div class="sub" id="pending-pct"></div></div>
<div class="card"><h3>Warming</h3><div class="big" id="warming" style="color:#6366f1"></div><div class="sub">IP reputation build</div></div>
<div class="card"><h3>Blocked</h3><div class="big" id="blocked" style="color:#ef4444"></div><div class="sub">Suspendu/bloqué</div></div>
<div class="card"><h3>Sends Lifetime</h3><div class="big" id="sends" style="color:#c084fc"></div><div class="sub">Tous tenants</div></div>
<div class="card"><h3>Tenants</h3><div class="big" id="tenants"></div><div class="sub" id="tenants-active"></div></div>
<div class="card"><h3>Exchange Configured</h3><div class="big" id="exchange"></div><div class="sub">Prêts à envoyer</div></div>
<div class="card"><h3>Health Score</h3><div class="big" id="health"></div><div class="health-bar"><div class="health-bar-fill" id="health-bar" style="width:0"></div></div></div>
</div>
<h2 style="color:#c084fc;margin:32px 0 16px">Tenants Actifs</h2>
<table>
<thead><tr><th>Tenant</th><th>Status</th><th>Users</th><th>Sends Today</th><th>Daily Limit</th></tr></thead>
<tbody id="tenants-body"><tr><td colspan="5" style="text-align:center;color:#9ca8d3">Chargement...</td></tr></tbody>
</table>
<div id="last-refresh" style="color:#9ca8d3;font-size:11px;font-style:italic;margin-top:16px">Initialisation...</div>
</div>
<script>
async function fetchLive() {
const fmt = n => (n || 0).toLocaleString('fr-FR');
try {
const [status, tenants] = await Promise.all([
fetch('/api/office-admins.php?action=status').then(r => r.json()),
fetch('/api/office-admins.php?action=tenants').then(r => r.json()),
]);
if (status.ok) {
document.getElementById('total').textContent = fmt(status.total);
document.getElementById('active').textContent = fmt(status.active);
document.getElementById('active-pct').textContent = status.total ? ((status.active / status.total * 100).toFixed(1) + '%') : '—';
document.getElementById('pending').textContent = fmt((status.total || 0) - (status.active || 0) - (status.warming || 0) - (status.suspended || 0));
document.getElementById('warming').textContent = fmt(status.warming);
document.getElementById('blocked').textContent = fmt(status.suspended);
document.getElementById('sends').textContent = fmt(status.sends);
document.getElementById('tenants').textContent = fmt(status.tenants);
document.getElementById('exchange').textContent = fmt(status.exchange);
const healthPct = parseInt(status.health) || 0;
document.getElementById('health').textContent = status.health;
document.getElementById('health-bar').style.width = healthPct + '%';
}
if (tenants.ok && tenants.tenants) {
const activeCount = tenants.tenants.filter(t => (t.status || '').toLowerCase() === 'active').length;
document.getElementById('tenants-active').textContent = `${activeCount} actifs`;
document.getElementById('tenants-body').innerHTML = tenants.tenants.map(t =>
`<tr>
<td><strong>${t.tenant_domain}</strong></td>
<td><span class="status-badge st-${(t.status||'').toLowerCase()}">${t.status || '?'}</span></td>
<td>${fmt(t.users_count)}</td>
<td>${fmt(t.sends_today)}</td>
<td>${fmt(t.daily_limit)}</td>
</tr>`
).join('');
}
document.getElementById('last-refresh').textContent = `Dernière MAJ: ${new Date().toLocaleTimeString('fr-FR')}`;
} catch (e) {
document.getElementById('last-refresh').textContent = 'Erreur: ' + e.message;
}
}
fetchLive();
setInterval(fetchLive, 30000);
</script>
<!-- === OPUS UNIVERSAL DRILL-DOWN v1 19avr — append-only, doctrine #14 === -->
<script>
(function(){
if (window.__opusUniversalDrill) return; window.__opusUniversalDrill = true;
var d = document;
var m = d.createElement('div');
m.id = 'opus-udrill';
m.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,0.82);backdrop-filter:blur(6px);display:none;align-items:center;justify-content:center;z-index:99995;padding:20px;cursor:pointer';
var inner = d.createElement('div');
inner.id = 'opus-udrill-in';
inner.style.cssText = 'max-width:900px;width:100%;max-height:90vh;overflow:auto;background:#0b0d15;border:1px solid rgba(99,102,241,0.35);border-radius:14px;padding:28px;cursor:default;box-shadow:0 20px 60px rgba(0,0,0,0.6);color:#e2e8f0;font:14px/1.55 Inter,system-ui,sans-serif';
inner.addEventListener('click', function(e){ e.stopPropagation(); });
m.appendChild(inner);
m.addEventListener('click', function(){ m.style.display='none'; });
d.addEventListener('keydown', function(e){ if(e.key==='Escape') m.style.display='none'; });
(d.body || d.documentElement).appendChild(m);
function openCard(card) {
// Clone card content + show close btn + increase font-size
var html = '<div style="display:flex;justify-content:flex-end;margin-bottom:14px"><button id="opus-udrill-close" style="padding:6px 14px;background:#171b2a;border:1px solid rgba(99,102,241,0.25);color:#e2e8f0;border-radius:8px;cursor:pointer;font-size:12px">✕ Fermer (Esc)</button></div>';
html += '<div style="transform-origin:top left;font-size:1.05em">' + card.outerHTML + '</div>';
inner.innerHTML = html;
d.getElementById('opus-udrill-close').onclick = function(){ m.style.display='none'; };
m.style.display = 'flex';
}
function wire(root) {
var sels = '.card,[class*="card"],.kpi,[class*="kpi"],.stat,[class*="stat"],.tile,[class*="tile"],.metric,[class*="metric"],.widget,[class*="widget"]';
var cards = root.querySelectorAll(sels);
for (var i = 0; i < cards.length; i++) {
var c = cards[i];
if (c.__opusWired) continue;
if (c.closest('button, a, input, select, textarea, #opus-udrill')) continue;
var r = c.getBoundingClientRect();
if (r.width < 60 || r.height < 40) continue;
c.__opusWired = true;
c.style.cursor = 'pointer';
c.setAttribute('role','button');
c.setAttribute('tabindex','0');
c.addEventListener('click', function(ev){
// If a more-specific drill is already active (e.g. pp-card custom), let it handle
if (ev.target.closest('[data-pp-id]') && window.__opusDrillInit) return;
if (ev.target.closest('a,button,input,select')) return;
ev.preventDefault(); ev.stopPropagation();
openCard(this);
});
c.addEventListener('keydown', function(ev){ if(ev.key==='Enter'||ev.key===' '){ev.preventDefault();openCard(this);} });
}
}
// Initial + mutation observer
var initRun = function(){ wire(d.body || d.documentElement); };
if (d.readyState === 'loading') d.addEventListener('DOMContentLoaded', initRun);
else initRun();
var mo = new MutationObserver(function(muts){
var newCard = false;
for (var i=0;i<muts.length;i++) if (muts[i].addedNodes.length) { newCard = true; break; }
if (newCard) initRun();
});
mo.observe(d.body || d.documentElement, {childList:true, subtree:true});
})();
</script>
<!-- === OPUS UNIVERSAL DRILL-DOWN END === -->
<script src="/api/a11y-auto-enhancer.js" defer></script>
<!-- WTP_UDOCK_V1 (Opus 21-avr t34final) --><script src="/wtp-unified-dock.js" defer></script>
<script src="/opus-antioverlap-doctrine.js?v=1776776094" defer></script>
</body>
</html>