Orchestrateur go pour lancer la démo et mettre en place plusieurs instances docker
This commit is contained in:
127
demo/orchestrator/preparing.html
Normal file
127
demo/orchestrator/preparing.html
Normal file
@@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoreMind — Demo en preparation</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background: #1a1625;
|
||||
color: #e4def5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
}
|
||||
.card {
|
||||
max-width: 440px;
|
||||
padding: 2.5rem 2rem;
|
||||
}
|
||||
.logo {
|
||||
font-size: 2rem;
|
||||
color: #b794f4;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.subtitle {
|
||||
letter-spacing: 0.2em;
|
||||
font-size: 0.75rem;
|
||||
color: #9880c4;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.35rem;
|
||||
font-weight: 500;
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
p {
|
||||
color: #aaa0c5;
|
||||
line-height: 1.6;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
.spinner {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: 1.5rem auto 0;
|
||||
border: 3px solid rgba(183, 148, 244, 0.2);
|
||||
border-top-color: #b794f4;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.error {
|
||||
display: none;
|
||||
margin-top: 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||
color: #fca5a5;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.error.visible { display: block; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="card">
|
||||
<div class="logo">✦ LoreMind</div>
|
||||
<div class="subtitle">THE DIGITAL CODEX</div>
|
||||
<h1>Preparation de votre demo…</h1>
|
||||
<p>
|
||||
Nous initialisons une instance isolee rien que pour vous.
|
||||
Cela prend generalement 20 a 40 secondes.
|
||||
</p>
|
||||
<p style="font-size: 0.8rem; color: #7d6ba0; margin-top: 1rem;">
|
||||
Votre session sera automatiquement reinitialisee au bout de 20 minutes.
|
||||
</p>
|
||||
<div class="spinner"></div>
|
||||
<div id="err" class="error"></div>
|
||||
</main>
|
||||
<script>
|
||||
(function () {
|
||||
var errBox = document.getElementById('err');
|
||||
var attempts = 0;
|
||||
var maxAttempts = 90; // 90 * 2s = 3 min max
|
||||
|
||||
function poll() {
|
||||
attempts++;
|
||||
fetch('/_demo/ready', { credentials: 'same-origin' })
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (data) {
|
||||
if (data.status === 'ready') {
|
||||
window.location.href = '/';
|
||||
return;
|
||||
}
|
||||
if (data.status === 'failed') {
|
||||
errBox.textContent = 'Echec du demarrage : ' + (data.error || 'raison inconnue') + '. Rechargez la page pour reessayer.';
|
||||
errBox.classList.add('visible');
|
||||
return;
|
||||
}
|
||||
if (attempts >= maxAttempts) {
|
||||
errBox.textContent = 'Timeout. Rechargez la page pour reessayer.';
|
||||
errBox.classList.add('visible');
|
||||
return;
|
||||
}
|
||||
setTimeout(poll, 2000);
|
||||
})
|
||||
.catch(function () {
|
||||
if (attempts >= maxAttempts) {
|
||||
errBox.textContent = 'Connexion perdue. Rechargez la page pour reessayer.';
|
||||
errBox.classList.add('visible');
|
||||
return;
|
||||
}
|
||||
setTimeout(poll, 2000);
|
||||
});
|
||||
}
|
||||
poll();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user