Files
powerhouse/test-progress.html

54 lines
2.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Тестирование форм — прогресс</title>
<style>
body{font-family:system-ui,sans-serif;background:#f5f5f5;padding:20px;color:#333}
h1{font-size:20px;color:#950f28;margin-bottom:16px}
.bar-wrap{background:#e0e0e0;border-radius:8px;height:30px;margin-bottom:12px;overflow:hidden}
.bar{background:#950f28;height:100%;border-radius:8px;transition:width .3s;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px}
.stats{display:flex;gap:20px;margin-bottom:12px;font-size:15px}
.stat{padding:8px 16px;border-radius:6px;font-weight:600}
.s-total{background:#e0e0e0} .s-pass{background:#d4edda;color:#155724} .s-fail{background:#f8d7da;color:#721c24}
.current{font-size:14px;color:#666;margin-bottom:8px}
.log{background:#fff;border-radius:6px;padding:12px;max-height:400px;overflow-y:auto;font-size:13px;font-family:monospace;line-height:1.6}
.log .pass{color:#155724} .log .fail{color:#721c24}
</style>
</head>
<body>
<h1>Тестирование форм CF7 → Битрикс24</h1>
<div class="bar-wrap"><div class="bar" id="bar" style="width:0%">0%</div></div>
<div class="stats">
<span class="stat s-total" id="s-total">Всего: 0</span>
<span class="stat s-pass" id="s-pass">✓ Пройдено: 0</span>
<span class="stat s-fail" id="s-fail">✗ Ошибки: 0</span>
</div>
<div class="current" id="current">Ожидание...</div>
<div class="log" id="log"></div>
<script>
var logEl = document.getElementById('log');
var prev = '';
function poll(){
fetch('/test-progress.json?t='+Date.now()).then(r=>r.json()).then(function(d){
var pct = d.total ? Math.round(d.tested/d.total*100) : 0;
document.getElementById('bar').style.width = pct+'%';
document.getElementById('bar').textContent = pct+'%';
document.getElementById('s-total').textContent = 'Всего: '+d.total;
document.getElementById('s-pass').textContent = '✓ Пройдено: '+d.passed;
document.getElementById('s-fail').textContent = '✗ Ошибки: '+d.failed;
document.getElementById('current').textContent = d.current||'';
if(d.current && d.current !== prev){
var cls = d.current.charAt(0)==='✓' ? 'pass' : (d.current.charAt(0)==='✗' ? 'fail' : '');
logEl.innerHTML += '<div class="'+cls+'">'+d.current+'</div>';
logEl.scrollTop = logEl.scrollHeight;
prev = d.current;
}
if(!d.done) setTimeout(poll, 1000);
}).catch(function(){setTimeout(poll, 2000);});
}
poll();
</script>
</body>
</html>