
        url.searchParams.set('src', src);

        try {
            await fetch(url, {method: 'DELETE'});
            reload();
        } catch (error) {
            console.error('Failed to delete the stream:', error);
        }
    });

    document.getElementById('selectall').addEventListener('change', ev => {
        document.querySelectorAll('#streams input').forEach(el => {
            el.checked = ev.target.checked;
        });
    });

    function reload() {
        const url = new URL('api/strea