Files
html/onboarding-em.html
2026-04-17 02:30:02 +02:00

67 lines
3.8 KiB
HTML

<!DOCTYPE html><html lang="fr"><head><meta charset="UTF-8"><title>Onboarding EM — WEVAL</title>
<style>
body{font-family:system-ui;background:#0a0e1a;color:#e2e8f0;margin:0;padding:20px}
.container{max-width:720px;margin:0 auto}
h1{color:#a5b4fc}
.steps{display:flex;gap:8px;margin-bottom:20px}
.step{flex:1;padding:10px;background:#151e33;border-radius:6px;text-align:center;font-size:.8rem;color:#64748b}
.step.active{background:#6366f1;color:#fff}
.step.done{background:#22c55e;color:#000}
.form{background:#151e33;padding:24px;border-radius:8px}
.field{margin-bottom:14px}
.field label{display:block;color:#94a3b8;margin-bottom:6px;font-size:.85rem}
.field input, .field select{width:100%;padding:10px;background:#0a0e1a;border:1px solid #1e293b;color:#e2e8f0;border-radius:6px;font:1rem system-ui}
.field input:focus,.field select:focus{border-color:#6366f1;outline:none}
.btn{padding:12px 24px;background:#6366f1;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:.95rem}
.btn:hover{background:#4f46e5}
.plans{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.plan{padding:16px;background:#0a0e1a;border:2px solid #1e293b;border-radius:8px;cursor:pointer;text-align:center}
.plan.selected{border-color:#6366f1;background:#1e1b4b}
.plan-name{font-weight:700;margin-bottom:6px}
.plan-price{color:#22d3ee;font-size:1.2rem;margin:8px 0}
.plan-features{color:#94a3b8;font-size:.75rem;text-align:left;margin-top:10px}
</style></head>
<body><div class="container">
<h1>🚀 Onboarding EM WEVAL</h1>
<div class="steps">
<div class="step done">1. Contact</div>
<div class="step done">2. Besoin</div>
<div class="step active">3. Plan</div>
<div class="step">4. POC</div>
<div class="step">5. Kick-off</div>
<div class="step">6. Bootstrap</div>
<div class="step">7. Dashboard</div>
</div>
<div class="form">
<div class="field"><label>Nom de l'organisation</label><input id="orgname" placeholder="CFAO Healthcare"></div>
<div class="field"><label>Email contact</label><input id="email" type="email" placeholder="contact@exemple.com"></div>
<div class="field"><label>Tenant ID (auto)</label><input id="tenantid" placeholder="auto-generé"></div>
<div class="field"><label>Plan</label></div>
<div class="plans" id="plans"></div>
<br>
<button class="btn" onclick="submit()">Démarrer onboarding</button>
<div id="result" style="margin-top:16px"></div>
</div>
</div>
<script>
let selectedPlan = 'poc';
fetch('/api/em/plans').then(r=>r.json()).then(d=>{
const html = (d.plans||[]).map(p=>`
<div class="plan ${p.plan_code==='poc'?'selected':''}" data-plan="${p.plan_code}" onclick="selectPlan('${p.plan_code}')">
<div class="plan-name">${p.plan_name}</div>
<div class="plan-price">${p.setup_fee>0?p.setup_fee+' '+p.currency+' setup':'Gratuit'}<br>${p.monthly_fee>0?p.monthly_fee+' '+p.currency+'/mois':''}</div>
<div class="plan-features">${(p.features||[]).slice(0,3).map(f=>'✓ '+f).join('<br>')}</div>
</div>`).join('');
document.getElementById('plans').innerHTML = html;
});
function selectPlan(p){selectedPlan=p;document.querySelectorAll('.plan').forEach(x=>x.classList.toggle('selected',x.dataset.plan===p));}
function submit(){
const tenant_id = document.getElementById('tenantid').value || ('tenant_'+Math.random().toString(36).slice(2,9));
fetch('/api/em/tenant/bootstrap', {method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({
tenant_id, name:document.getElementById('orgname').value, email:document.getElementById('email').value, plan:selectedPlan
})}).then(r=>r.json()).then(d=>{
document.getElementById('result').innerHTML = `<div style="padding:14px;background:#065f46;border-radius:6px">✅ Tenant ${d.tenant_id} créé!<br><a href="${d.dashboard}" style="color:#fff">→ Accéder au Brain Center</a></div>`;
});
}
</script></body></html>