Live Counter get total count per batch
This commit is contained in:
1 parent
fe220504fd
commit
e3ae89de3d
4 files changed
+82
-1
No files matched your search
@@ -356,6 +356,22 @@
|
||||
<div class="counter-status disconnected" id="live-status">
|
||||
waiting...
|
||||
</div>
|
||||
<div class="batch-result" id="batch-result" style="display:none;margin-top:16px;padding:12px;border-top:1px solid var(--divider);">
|
||||
<div style="font-size:9px;color:var(--text-secondary);letter-spacing:1px;text-transform:uppercase;margin-bottom:6px;">
|
||||
Selected Batch Result
|
||||
</div>
|
||||
<div style="display:flex;align-items:center;justify-content:center;gap:32px;">
|
||||
<div>
|
||||
<div style="font-size:8px;color:var(--text-secondary);letter-spacing:1px;">BATCH</div>
|
||||
<div style="font-family:'Orbitron',sans-serif;font-size:20px;font-weight:700;color:var(--accent);" id="br-batch">--</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size:8px;color:var(--text-secondary);letter-spacing:1px;">COUNT</div>
|
||||
<div style="font-family:'Orbitron',sans-serif;font-size:20px;font-weight:700;color:var(--accent4);" id="br-count">--</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size:9px;color:var(--text-secondary);margin-top:6px;" id="br-date">--</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
@@ -467,7 +483,31 @@ function selectFile(path, name) {
|
||||
selectedFile = path;
|
||||
document.getElementById('btn-start').disabled = false;
|
||||
document.getElementById('stream-file-name').textContent = name;
|
||||
loadFiles(); // refresh selection
|
||||
loadFiles();
|
||||
loadBatchResult(path);
|
||||
}
|
||||
|
||||
async function loadBatchResult(filePath) {
|
||||
const el = document.getElementById('batch-result');
|
||||
if (!filePath) {
|
||||
el.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await fetch('/api/batch-result?file=' + encodeURIComponent(filePath));
|
||||
const data = await res.json();
|
||||
if (!data.success) {
|
||||
el.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
document.getElementById('br-batch').textContent = '#' + data.batch_number;
|
||||
document.getElementById('br-count').textContent = data.count.toLocaleString();
|
||||
document.getElementById('br-date').textContent = data.date;
|
||||
el.style.display = 'block';
|
||||
} catch (err) {
|
||||
console.error('Failed to load batch result:', err);
|
||||
el.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function formatSize(bytes) {
|
||||
|
||||
Reference in new issue
Block a user