|
|
|
@ -183,7 +183,32 @@ async function handleToggleRules(element)
|
|
|
|
|
`
|
|
|
|
|
rulesElement.classList.remove('hidden')
|
|
|
|
|
}
|
|
|
|
|
function handleToggleFeeds(element)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function deleteRule(element)
|
|
|
|
|
{
|
|
|
|
|
var ruleID = document.getElementById('roleRule').classList[1];
|
|
|
|
|
fetch(`${window.location.origin}/api/deleteRule`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
mode: "cors",
|
|
|
|
|
headers: {ruleID},
|
|
|
|
|
})
|
|
|
|
|
.then(result => result.json())
|
|
|
|
|
.then(res =>
|
|
|
|
|
{
|
|
|
|
|
console.log(res);
|
|
|
|
|
if(res.success)
|
|
|
|
|
{
|
|
|
|
|
element.parentNode.classList.add('hidden')
|
|
|
|
|
document.getElementById('popup').classList.remove('hidden');
|
|
|
|
|
}
|
|
|
|
|
else alert(res.error);
|
|
|
|
|
})
|
|
|
|
|
.catch(console.error);
|
|
|
|
|
}
|
|
|
|
|
function addRule(element)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|