New supervision

- using fastAPI
- offline/online working
- warning if ZABBIX API is too long
- showing settings
- showing last ack message
- showing procedure
- menu split by SU team
This commit is contained in:
sylvain.chateau
2024-02-05 15:44:27 +01:00
parent f493406b5b
commit f2235d4b45
60 changed files with 10017 additions and 221 deletions

38
js/super.js Normal file
View File

@ -0,0 +1,38 @@
const REFRESH_PAGE = 60000
$(document).ready(function() {
if (window.tvMode === true) {
$('nav').hide();
$('form').hide();
} else {
$('nav').show();
$('form').show();
}
$('#url').val($(location).attr('href'));
$('.url_note').val($(location).attr('href'));
$(document).on('click', '.del_note', function(e) {
if (!confirm("This note will be deleted. Are you sure?")) {
e.preventDefault();
}
});
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
function checkHealth() {
fetch('/healthcheck')
.then(response => {
if (response.ok) {
window.location.reload();
} else {
throw new Error('Server responded with an error!');
}
})
.catch(error => {
$('#health-status').removeClass('badge-success').addClass('badge-danger').text('Super is DOWN');
});
}
setInterval(checkHealth, REFRESH_PAGE);
});