Files
autoban/static/js/set_log_level.js
2026-01-01 02:13:34 +01:00

17 lines
563 B
JavaScript

document.getElementById('setLogLevelForm').addEventListener('submit', function(e) {
e.preventDefault();
const level = document.getElementById('appLogLevel').value;
fetch(SET_LOG_LEVEL_URL, {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'level=' + encodeURIComponent(level)
})
.then(res => res.json())
.then(data => {
window.showToast({ text: data.message, variant: 'success' });
})
.catch(() => {
window.showToast({ text: "Błąd podczas zmiany poziomu", variant: "error" });
});
});