Lotto2PY/6aus49APP/static/app.js
2025-10-19 17:46:58 +02:00

41 lines
1.3 KiB
JavaScript
Raw 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.

function renderDrawsTable(data) {
if (!data || !Array.isArray(data.items)) {
return '<p class="muted">Keine Daten</p>';
}
const rows = data.items.map(d => `
<tr>
<td class="nowrap"><a href="/api/draw/${d.datum}" target="_blank">${d.datum}</a></td>
<td class="numbers">${[d.z1,d.z2,d.z3,d.z4,d.z5,d.z6].map(n => `<span class="badge">${n}</span>`).join(' ')}</td>
<td class="nowrap"><strong>${d.sz}</strong></td>
</tr>
`).join('');
return `
<p class="muted">Treffer: ${data.total}</p>
<table role="grid">
<thead>
<tr><th>Datum</th><th>Zahlen</th><th>Superzahl</th></tr>
</thead>
<tbody>${rows}</tbody>
</table>`;
}
function renderFrequencyPanels(data) {
const z = (data.zahlen || []).map(x => `<tr><td>${x.zahl}</td><td>${x.haeufigkeit}</td></tr>`).join('');
const sz = (data.superzahl || []).map(x => `<tr><td>${x.zahl}</td><td>${x.haeufigkeit}</td></tr>`).join('');
return `
<div>
<h3>Häufigkeit Zahlen (149)</h3>
<table role="grid">
<thead><tr><th>Zahl</th><th>Häufigkeit</th></tr></thead>
<tbody>${z}</tbody>
</table>
</div>
<div>
<h3>Häufigkeit Superzahl (09)</h3>
<table role="grid">
<thead><tr><th>Superzahl</th><th>Häufigkeit</th></tr></thead>
<tbody>${sz}</tbody>
</table>
</div>`;
}