Add a delete option to each recording in the web view

This commit is contained in:
Sashanoraa
2025-04-02 23:50:57 -04:00
committed by Will Greenberg
parent df8a1f5606
commit 326d4106bd
5 changed files with 69 additions and 3 deletions

View File

@@ -125,6 +125,16 @@ function createLink(uri, text) {
return link;
}
function createButton(uri, text) {
const link = document.createElement('button');
link.innerText = text;
link.onclick = async () => {
await req('POST', uri);
populateDivs();
};
return link;
}
function createEntryRow(entry, isCurrent) {
const row = document.createElement('tr');
const name = document.createElement('th');
@@ -153,6 +163,10 @@ function createEntryRow(entry, isCurrent) {
}
row.appendChild(analysisResult);
const actionsButtons = document.createElement('td');
actionsButtons.appendChild(createButton(`/api/delete-recording/${entry.name}`, 'Delete'));
row.appendChild(actionsButtons);
return row;
}