Files
html/tasks-live.html
Opus Wire c2d4547e3e
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
feat(wtp-udock-v1): propagation batch 3 - 24 pages secondaires (46/294 total 15.6%)
Couverture dock nav:
- Tour 29: 10 pages
- Tour 30 batch 2: +12 (22 total)
- Tour 31 batch 3: +24 (46 total)

Pages injectees batch 3 (+92 bytes chacune, additif idempotent):
* Dashboards: api-key-hub, tasks-live, nonreg, monitoring, trust-center
* Pages hub: methodologie, playbook-3-phases, integrations-marketplace, automation-hub
* Navigation: pages-index, weval-sitemap
* Business: candidates-pool, contacts-segmentation-dashboard, kaouther-compose
* Landings: landing-industrie, landing-ocp, landing-banque, landing-retail, ecosysteme-ia-maroc
* Controls: linkedin-control-v98, blade-control, world-map-live, vsm-15depts-NEW, nl-autowire-status

SKIP: vsm-pipelines.html (chattr+i)
GOLD: /opt/wevads/vault/gold_*_t31_*.html
Doctrine: ERP Global single source nav · Zero ecrasement · Zero regression · Idempotent
2026-04-21 13:01:30 +02:00

321 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="fr"><head>
<meta charset="UTF-8"><title>Tasks & Logs Live · WEVIA streaming</title>
<style>
body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;background:#0a0e27;color:#e4e8f7;margin:0;padding:0;line-height:1.5}
.container{max-width:1400px;margin:0 auto;padding:24px}
h1{color:#6ba3ff;border-bottom:2px solid #1e3a8a;padding-bottom:8px;margin-top:0}
h2{color:#c084fc;margin-top:20px}
.grid{display:grid;grid-template-columns:1fr 2fr;gap:16px;margin-top:16px}
@media(max-width:900px){.grid{grid-template-columns:1fr}}
.card{background:#141933;border:1px solid #263161;border-radius:8px;padding:16px;margin-bottom:12px}
.log-item{background:#0f1529;padding:10px;border-radius:4px;margin-bottom:8px;border-left:3px solid #6ba3ff;cursor:pointer;transition:all 0.15s}
.log-item:hover{border-left-color:#10b981;background:#15203f}
.log-item.active{border-left-color:#fbbf24;background:#1a2547}
.log-name{color:#fbbf24;font-weight:bold;font-size:13px}
.log-meta{color:#9ca8d3;font-size:11px;margin-top:4px}
.log-tail{color:#d1d5db;font-family:'SF Mono',Monaco,monospace;font-size:11px;margin-top:6px;max-height:60px;overflow:hidden;white-space:pre-wrap}
.badge{padding:2px 6px;border-radius:3px;font-size:10px;font-weight:bold;display:inline-block}
.live{background:#10b981;color:#fff}.old{background:#6b7280;color:#fff}.running{background:#3b82f6;color:#fff}
.svc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
.svc{background:#0f1529;padding:8px 12px;border-radius:4px;border-left:3px solid #6b7280;font-size:12px}
.svc.active{border-left-color:#10b981}
.svc.inactive{border-left-color:#ef4444;opacity:0.7}
#tail-view{background:#000;color:#0f0;padding:12px;border-radius:4px;font-family:'SF Mono',Monaco,monospace;font-size:11px;white-space:pre-wrap;max-height:500px;overflow-y:auto;border:1px solid #263161}
#stream-view{background:#0a0e27;padding:12px;border-radius:4px;font-family:Monaco,monospace;font-size:11px;white-space:pre-wrap;max-height:400px;overflow-y:auto;border:1px solid #1e3a8a}
.stream-msg{color:#9ca8d3;padding:2px 0}
.stream-msg .ts{color:#6ba3ff;margin-right:8px}
.stream-msg .type{color:#fbbf24;margin-right:8px;font-weight:bold}
button{background:#1e3a8a;color:#fff;border:0;padding:8px 14px;border-radius:4px;cursor:pointer;font-size:12px;margin-right:4px}
button:hover{background:#2950a7}
input,select{background:#0f1529;color:#e4e8f7;border:1px solid #263161;padding:6px 10px;border-radius:4px;font-size:13px;font-family:inherit}
.status-bar{background:#0f1529;padding:10px 16px;border-radius:4px;display:flex;gap:16px;flex-wrap:wrap;align-items:center;font-size:12px;margin-bottom:16px}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:4px;animation:pulse 2s infinite}
.dot.green{background:#10b981}.dot.red{background:#ef4444}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}
a{color:#6ba3ff}
</style></head>
<body>
<div class="container">
<h1>📡 Tasks & Logs Live · WEVIA streaming</h1>
<div class="status-bar">
<span><span class="dot green"></span><strong id="status-ok">LIVE</strong></span>
<span>Logs 24h: <strong id="logs-count"></strong></span>
<span>Processes: <strong id="proc-count"></strong></span>
<span>Services actifs: <strong id="svc-active"></strong>/<strong id="svc-total"></strong></span>
<span>Dernier refresh: <strong id="ts"></strong></span>
<button onclick="refresh()">🔄 Refresh</button>
</div>
<div class="grid">
<div>
<h2>📋 Logs récents (24h)</h2>
<div id="logs-list" class="card">Chargement…</div>
<h2>⚙️ Services systemd</h2>
<div class="card"><div id="svc-list" class="svc-grid">Chargement…</div></div>
<h2>🔄 Processus actifs</h2>
<div id="proc-list" class="card" style="max-height:300px;overflow-y:auto">Chargement…</div>
</div>
<div>
<h2>📜 Contenu log sélectionné</h2>
<div class="card">
<div style="margin-bottom:8px">
<span>Fichier: <strong id="cur-file">(aucun sélectionné)</strong></span>
&nbsp; Lignes: <select id="n-lines" onchange="reloadTail()"><option value="20">20</option><option value="50" selected>50</option><option value="100">100</option><option value="200">200</option></select>
&nbsp; <button onclick="reloadTail()">🔄 Reload</button>
&nbsp; <button onclick="toggleAuto()"><span id="auto-lbl">▶️ Auto-refresh 5s</span></button>
</div>
<div id="tail-view">Clique un log dans la liste à gauche…</div>
</div>
<h2>📡 Stream multiagent WEVIA</h2>
<div class="card">
<div style="margin-bottom:8px">
<input id="task-msg" placeholder="Message multiagent (ex: 'scan screens health')" style="width:60%" />
<button onclick="startStream()">▶️ Lancer streaming</button>
<button onclick="stopStream()">⏹️ Stop</button>
</div>
<div id="stream-view">Entre un message puis "Lancer streaming" pour voir le flux d'exécution multiagent en temps réel…</div>
</div>
</div>
</div>
<h2>🔗 Liens</h2>
<div class="card">
<ul>
<li><a href="/api/tasks-live-api.php?action=latest" target="_blank">API tasks-live JSON</a></li>
<li><a href="/wevia-master.html">WEVIA Master (chat full)</a></li>
<li><a href="/infra-dashboard-live.html">Infra dashboard live</a></li>
<li><a href="/database-dashboard-live.html">Database live</a></li>
<li><a href="/dormant-dashboard.html">Dormant capabilities</a></li>
<li><a href="/kaouther-compose.html">Kaouther compose 3 emails</a></li>
<li><a href="/azure-reregister.html">Azure AD re-register</a></li>
<li><a href="/decision-gmail-o365.html">Décision Gmail→O365</a></li>
</ul>
</div>
</div>
<script>
let currentFile = null;
let autoTimer = null;
let streamSrc = null;
async function refresh() {
try {
const r = await fetch('/api/tasks-live-api.php?action=latest');
const d = await r.json();
if (!d.ok) throw new Error('api error');
document.getElementById('logs-count').textContent = d.logs_count;
document.getElementById('proc-count').textContent = d.process_count;
document.getElementById('ts').textContent = new Date(d.ts).toLocaleTimeString();
// Logs list
const ll = document.getElementById('logs-list');
if (d.logs.length) {
ll.innerHTML = d.logs.map(l => {
const badge = l.age_minutes < 5 ? '<span class="badge live">⚡ LIVE</span>' :
l.age_minutes < 60 ? '<span class="badge running">✓ ' + l.age_minutes + 'min</span>' :
'<span class="badge old">' + l.age_minutes + 'min</span>';
return `<div class="log-item" data-file="${l.file}" onclick="selectFile('${l.file}')">
<div class="log-name">${l.file} ${badge}</div>
<div class="log-meta">${l.last_modified} · ${(l.size_bytes/1024).toFixed(1)}KB</div>
<div class="log-tail">${escapeHtml(l.tail || '').slice(0, 200)}</div>
</div>`;
}).join('');
} else {
ll.innerHTML = '<div style="color:#9ca8d3">Aucun log 24h</div>';
}
// Services
const sl = document.getElementById('svc-list');
let active = 0, total = 0;
sl.innerHTML = Object.entries(d.services).map(([name, status]) => {
total++;
const cls = status === 'active' ? 'active' : 'inactive';
if (status === 'active') active++;
return `<div class="svc ${cls}">${name}<br><span style="color:#9ca8d3">${status}</span></div>`;
}).join('');
document.getElementById('svc-active').textContent = active;
document.getElementById('svc-total').textContent = total;
// Processes
const pl = document.getElementById('proc-list');
if (d.active_processes.length) {
pl.innerHTML = d.active_processes.map(p =>
`<div style="padding:6px;border-bottom:1px solid #263161;font-family:monospace;font-size:11px">
<span style="color:#fbbf24">[${p.pid}]</span>
<span style="color:#10b981">${p.cpu}%CPU</span>
<span style="color:#3b82f6">${p.mem}%MEM</span>
${escapeHtml(p.cmd)}
</div>`
).join('');
} else {
pl.innerHTML = '<div style="color:#9ca8d3">Aucun processus WEVIA/trainer actif</div>';
}
// Re-highlight current file
if (currentFile) {
document.querySelectorAll('.log-item').forEach(el => {
if (el.dataset.file === currentFile) el.classList.add('active');
});
}
} catch(e) {
document.getElementById('status-ok').textContent = 'ERROR: ' + e.message;
}
}
function escapeHtml(s) {
return (s || '').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
async function selectFile(f) {
currentFile = f;
document.getElementById('cur-file').textContent = f;
document.querySelectorAll('.log-item').forEach(el => {
el.classList.toggle('active', el.dataset.file === f);
});
reloadTail();
}
async function reloadTail() {
if (!currentFile) return;
const n = document.getElementById('n-lines').value;
try {
const r = await fetch(`/api/tasks-live-api.php?action=tail&file=${encodeURIComponent(currentFile)}&n=${n}`);
const d = await r.json();
document.getElementById('tail-view').textContent = d.content || '(vide)';
} catch(e) {
document.getElementById('tail-view').textContent = 'Erreur: ' + e.message;
}
}
let autoActive = false;
function toggleAuto() {
autoActive = !autoActive;
document.getElementById('auto-lbl').textContent = autoActive ? '⏸️ Auto ON (5s)' : '▶️ Auto-refresh 5s';
if (autoActive) {
autoTimer = setInterval(() => { reloadTail(); refresh(); }, 5000);
} else {
clearInterval(autoTimer);
}
}
function startStream() {
const msg = document.getElementById('task-msg').value.trim();
if (!msg) { alert('Entre un message'); return; }
stopStream();
const sv = document.getElementById('stream-view');
sv.innerHTML = '';
const appendStream = (obj) => {
const div = document.createElement('div');
div.className = 'stream-msg';
const ts = new Date().toLocaleTimeString();
const type = obj.type || obj.id || 'msg';
div.innerHTML = `<span class="ts">${ts}</span><span class="type">[${escapeHtml(type)}]</span> ${escapeHtml(JSON.stringify(obj).slice(0, 500))}`;
sv.appendChild(div);
sv.scrollTop = sv.scrollHeight;
};
appendStream({type:'start', task: msg});
streamSrc = new EventSource(`/api/wevia-sse-orchestrator.php?msg=${encodeURIComponent(msg)}`);
streamSrc.onmessage = (e) => {
try {
const d = JSON.parse(e.data);
appendStream(d);
if (d.type === 'done' || d.type === 'end') stopStream();
} catch(err) {
appendStream({type:'raw', data: e.data.slice(0, 300)});
}
};
streamSrc.onerror = (e) => {
appendStream({type:'error', note: 'connection closed or error'});
stopStream();
};
}
function stopStream() {
if (streamSrc) { streamSrc.close(); streamSrc = null; }
}
// Initial load + refresh every 10s
refresh();
setInterval(refresh, 10000);
</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 t31b3) --><script src="/wtp-unified-dock.js" defer></script>
</body></html>