changed to db for fit streams

This commit is contained in:
2026-01-14 05:39:16 -08:00
parent 362f4cb5aa
commit 45dbc32295
99 changed files with 2118 additions and 1684 deletions

View File

@@ -189,6 +189,9 @@
<button class="btn btn-sm btn-outline-danger" onclick="deleteSegment(${seg.id})">
<i class="bi bi-trash"></i>
</button>
<button class="btn btn-sm btn-outline-secondary" onclick="scanSingleSegment(${seg.id})" title="Scan for matches">
<i class="bi bi-arrow-repeat"></i>
</button>
</td>
`;
tbody.appendChild(tr);
@@ -200,6 +203,23 @@
}
}
async function scanSingleSegment(id) {
if (!confirm("Rescan this segment against all activities?")) return;
try {
// Show loading state?
const res = await fetch(`/api/segments/${id}/scan`, { method: 'POST' });
if (!res.ok) throw new Error("Scan failed");
const data = await res.json();
alert(`Scan Complete!\nFound ${data.matches_found} matching activities.`);
loadSegments(); // Refresh counts
} catch (e) {
alert("Error: " + e.message);
}
}
async function deleteSegment(id) {
if (!confirm("Are you sure you want to delete this segment? All matched efforts will be lost.")) return;