Adds factory reset checks button to the 'All' checks page

Addresses #5898
This commit is contained in:
Simone Mainardi 2021-09-21 17:13:08 +02:00
parent d9d36e117e
commit 2713d96653
3 changed files with 37 additions and 3 deletions

View file

@ -2003,4 +2003,18 @@ $(function () {
})
})
$(`#btn-confirm-action_factory-reset-modal`).click(async function () {
$.post(`${http_prefix}/lua/rest/v2/reset/checks/config.lua`, {
csrf: pageCsrf
})
.then((result) => {
if (result.rc_str == "OK") location.reload();
})
.catch((error) => {
console.error(error);
})
.always(() => {
})
})
});