Add selectall checkbox

This commit is contained in:
Alexey Khit
2023-03-19 16:44:17 +03:00
parent bd79b24db3
commit 43840576ea
+7 -1
View File
@@ -73,7 +73,7 @@
<table id="streams">
<thead>
<tr>
<th>Name</th>
<th><input id="selectall" type="checkbox">Name</th>
<th>Online</th>
<th>Commands</th>
</tr>
@@ -117,6 +117,12 @@
fetch(url, {method: "DELETE"}).then(reload);
});
document.getElementById('selectall').addEventListener('change', ev => {
document.querySelectorAll('#streams input').forEach(el => {
el.checked = ev.target.checked
})
})
function reload() {
const url = new URL("api/streams", location.href);
fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => {