mirror of
https://github.com/outscale/zabbix-super-vision.git
synced 2025-06-23 02:14:31 +02:00
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:
38
js/super.js
Normal file
38
js/super.js
Normal 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);
|
||||
});
|
Reference in New Issue
Block a user