mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 23:49:59 -07:00
Add a delete option to each recording in the web view
This commit is contained in:
committed by
Will Greenberg
parent
df8a1f5606
commit
326d4106bd
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user