Aktualisierung
This commit is contained in:
parent
bebb0a0aa5
commit
47ebaa4fcd
10 changed files with 180 additions and 0 deletions
41
6aus49APP/static/app.js
Normal file
41
6aus49APP/static/app.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
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 (1–49)</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 (0–9)</h3>
|
||||
<table role="grid">
|
||||
<thead><tr><th>Superzahl</th><th>Häufigkeit</th></tr></thead>
|
||||
<tbody>${sz}</tbody>
|
||||
</table>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
56
6aus49APP/templates/index.html.bak
Normal file
56
6aus49APP/templates/index.html.bak
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>6aus49 – Auswertung</title>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||
<style>
|
||||
body { max-width: 1100px; margin: auto; }
|
||||
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: .5rem; }
|
||||
.nowrap { white-space: nowrap; }
|
||||
.numbers span { display:inline-block; min-width: 2.2ch; text-align: center; }
|
||||
.badge { border: 1px solid var(--pico-primary); border-radius: 4px; padding: 0 .3rem; margin: 0 .1rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>6aus49 – Ziehungen</h1>
|
||||
|
||||
<!-- Reduziertes Filterformular -->
|
||||
<form id="filterForm" class="grid"
|
||||
hx-get="/ui/draws"
|
||||
hx-target="#result"
|
||||
hx-trigger="change, submit"
|
||||
hx-include="#filterForm">
|
||||
<label>
|
||||
Von
|
||||
<input type="date" name="date_from">
|
||||
</label>
|
||||
<label>
|
||||
Bis
|
||||
<input type="date" name="date_to">
|
||||
</label>
|
||||
<label>
|
||||
Limit
|
||||
<input type="number" name="limit" min="1" max="500" value="10">
|
||||
</label>
|
||||
<label>
|
||||
Reihenfolge
|
||||
<select name="order">
|
||||
<option value="desc" selected>Neueste zuerst</option>
|
||||
<option value="asc">Älteste zuerst</option>
|
||||
</select>
|
||||
</label>
|
||||
<div style="grid-column: 1 / -1; display:flex; gap:.5rem;">
|
||||
<button type="submit" class="primary">Anzeigen</button>
|
||||
<button type="reset">Zurücksetzen</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Ergebniscontainer: lädt initial -->
|
||||
<div id="result" hx-get="/ui/draws" hx-trigger="load" hx-target="#result">
|
||||
<!-- Tabelle wird hier eingefügt -->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue