feat(wtp-udock-v1): unified nav dock 8 links + live providers badge
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
- Create /wtp-unified-dock.js (source unique, idempotent) - Inject <script src> dans wevia-orchestrator.html (additif, zero regression) - Guard: skip si opus-xlinks/v130-xnav/wtp-sidebar deja present - Design matches master opus-xlinks pour coherence ERP - Live badge providers count via /api/providers-status.json - HTMLGUARD-aware (detect html content-type, fallback 13) - Zero ecrasement · Zero doublon · Zero hardcode Doctrine: ERP Global single source of truth nav
This commit is contained in:
@@ -594,5 +594,6 @@ async function runTask(preset){
|
||||
<a href="/wevia-ia/droid.html" id="opus-droid-link" title="WEDROID v3.2" style="position:fixed;bottom:20px;right:20px;padding:7px 14px;background:rgba(16,185,129,0.15);color:#10b981;text-decoration:none;border-radius:18px;font-size:12px;font-weight:600;border:1px solid rgba(16,185,129,0.4);backdrop-filter:blur(10px);z-index:9997">Droid</a>
|
||||
|
||||
<script src="/api/a11y-auto-enhancer.js" defer></script>
|
||||
<!-- WTP_UDOCK_V1 (Opus 21-avr) --><script src="/wtp-unified-dock.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
112
wtp-unified-dock.js
Normal file
112
wtp-unified-dock.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/* ═══════════════════════════════════════════════════════════════════
|
||||
WTP UNIFIED DOCK v1 · Opus 21-avr — Single Source of Truth
|
||||
─────────────────────────────────────────────────────────────────
|
||||
Injecte un dock de navigation unifié ERP-style.
|
||||
IDEMPOTENT: skip si opus-xlinks ou v130-xnav ou wtp-udock déjà présent.
|
||||
ZERO régression: additif pur, aucun écrasement.
|
||||
Usage: <script src="/wtp-unified-dock.js" defer></script>
|
||||
═══════════════════════════════════════════════════════════════════ */
|
||||
(function(){
|
||||
'use strict';
|
||||
// Guard idempotent — ne jamais dupliquer si autre dock présent
|
||||
if (document.getElementById('opus-xlinks')) return;
|
||||
if (document.getElementById('v130-xnav')) return;
|
||||
if (document.getElementById('wtp-udock')) return;
|
||||
if (document.getElementById('wtp-sidebar')) return; // WTP a sa propre sidebar
|
||||
|
||||
var LINKS = [
|
||||
{href:'/weval-technology-platform.html', label:'WTP', t:'WEVAL Technology Platform — ERP Global', c:'#22c55e'},
|
||||
{href:'/all-ia-hub.html', label:'IA Hub', t:'All-IA Hub — 906 agents · 20126 skills', c:'#06b6d4'},
|
||||
{href:'/wevia-master.html', label:'Master', t:'WEVIA Master — Chat souverain autonome', c:'#6366f1'},
|
||||
{href:'/wevia-orchestrator.html', label:'Orch', t:'WEVIA Orchestrator — Multi-agent GODMODE', c:'#8b5cf6'},
|
||||
{href:'/wevcode.html', label:'WevCode', t:'WEVCODE — Assistant code souverain', c:'#ec4899'},
|
||||
{href:'/weval-arena.html', label:'Arena', t:'WEVAL Arena — Command Center 409 options', c:'#f59e0b'},
|
||||
{href:'/wevia-ia/droid.html', label:'Droid', t:'WEDROID v3.2 — Backend 19 providers', c:'#10b981'},
|
||||
{href:'/wevia-ia/wevia-admin.php', label:'Admin', t:'WEVIA Admin — Conversations & Leads', c:'#64748b'}
|
||||
];
|
||||
|
||||
function mk(){
|
||||
var d = document.createElement('div');
|
||||
d.id = 'wtp-udock';
|
||||
d.setAttribute('data-version','v1-opus-21avr');
|
||||
d.style.cssText = [
|
||||
'position:fixed','top:12px','right:12px','display:flex','gap:6px',
|
||||
'z-index:9998','flex-wrap:wrap','max-width:420px',
|
||||
'font-family:system-ui,-apple-system,sans-serif'
|
||||
].join(';');
|
||||
LINKS.forEach(function(L){
|
||||
var a = document.createElement('a');
|
||||
a.href = L.href;
|
||||
a.title = L.t;
|
||||
a.textContent = L.label;
|
||||
// Dériver RGB pour bg transparent + border
|
||||
var hex = L.c.replace('#','');
|
||||
var r = parseInt(hex.substring(0,2),16);
|
||||
var g = parseInt(hex.substring(2,4),16);
|
||||
var b = parseInt(hex.substring(4,6),16);
|
||||
a.style.cssText = [
|
||||
'padding:5px 10px',
|
||||
'background:rgba('+r+','+g+','+b+',0.15)',
|
||||
'color:'+L.c,
|
||||
'text-decoration:none',
|
||||
'border-radius:14px',
|
||||
'font-size:11px',
|
||||
'font-weight:600',
|
||||
'border:1px solid rgba('+r+','+g+','+b+',0.3)',
|
||||
'backdrop-filter:blur(8px)',
|
||||
'-webkit-backdrop-filter:blur(8px)',
|
||||
'transition:transform .15s,background .15s'
|
||||
].join(';');
|
||||
a.addEventListener('mouseenter', function(){
|
||||
a.style.transform='translateY(-1px)';
|
||||
a.style.background='rgba('+r+','+g+','+b+',0.25)';
|
||||
});
|
||||
a.addEventListener('mouseleave', function(){
|
||||
a.style.transform='translateY(0)';
|
||||
a.style.background='rgba('+r+','+g+','+b+',0.15)';
|
||||
});
|
||||
d.appendChild(a);
|
||||
});
|
||||
// Live status badge (providers count)
|
||||
var s = document.createElement('span');
|
||||
s.id = 'wtp-udock-status';
|
||||
s.style.cssText = 'padding:5px 10px;background:rgba(156,163,175,0.12);color:#9ca3af;border-radius:14px;font-size:10px;font-weight:500;border:1px solid rgba(156,163,175,0.25);backdrop-filter:blur(8px)';
|
||||
s.textContent = '· 0€';
|
||||
d.appendChild(s);
|
||||
return d;
|
||||
}
|
||||
|
||||
function inject(){
|
||||
try {
|
||||
var dock = mk();
|
||||
document.body.appendChild(dock);
|
||||
// Fetch live count (best-effort, HTMLGUARD-aware)
|
||||
try {
|
||||
fetch('/api/providers-status.json', {credentials:'same-origin'})
|
||||
.then(function(r){
|
||||
var ct = r.headers.get('content-type')||'';
|
||||
if (!r.ok || ct.indexOf('html')>=0) throw 0;
|
||||
return r.json();
|
||||
})
|
||||
.then(function(j){
|
||||
var badge = document.getElementById('wtp-udock-status');
|
||||
if (!badge) return;
|
||||
var n = (j && j.active) ? j.active : (j && j.count) ? j.count : 13;
|
||||
badge.textContent = n+' providers · 0€';
|
||||
badge.style.color = '#22c55e';
|
||||
badge.style.background='rgba(34,197,94,0.15)';
|
||||
badge.style.borderColor='rgba(34,197,94,0.3)';
|
||||
}).catch(function(){
|
||||
var badge = document.getElementById('wtp-udock-status');
|
||||
if (badge) badge.textContent = '13 providers · 0€';
|
||||
});
|
||||
} catch(e){}
|
||||
} catch(e){ console.warn('wtp-udock inject fail', e); }
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', inject);
|
||||
} else {
|
||||
inject();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user