Add selectall checkbox
This commit is contained in:
+7
-1
@@ -73,7 +73,7 @@
|
|||||||
<table id="streams">
|
<table id="streams">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th><input id="selectall" type="checkbox">Name</th>
|
||||||
<th>Online</th>
|
<th>Online</th>
|
||||||
<th>Commands</th>
|
<th>Commands</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -117,6 +117,12 @@
|
|||||||
fetch(url, {method: "DELETE"}).then(reload);
|
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() {
|
function reload() {
|
||||||
const url = new URL("api/streams", location.href);
|
const url = new URL("api/streams", location.href);
|
||||||
fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => {
|
fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user