changed to db for fit streams
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user