const SERVICE_BLACKLIST = [
'ixvd.net',
'proxy',
'2d.neo.ixvd.net',
'pad.sandbox.neo.ixvd.net',
];
const serviceHolderDiv = document.querySelector('#service-holder');
serviceHolderDiv.innerHTML = 'Loading...';
async function updateServices() {
let fetchResult = await (await fetch('/relay/gatus')).json()
serviceHolderDiv.innerHTML = '';
fetchResult.forEach(s => {
if (!s.results || s.results.length === 0) return;
let service = s.results[0];
if (service.hostname && !SERVICE_BLACKLIST.includes(service.hostname) && service.status === 200) {
let serviceDiv = document.createElement('div');
serviceDiv.classList.add('service');
serviceDiv.innerHTML = `
${s.name}
${service.success ? 'Online' : 'Offline'}
`;
serviceHolderDiv.appendChild(serviceDiv);
}
})
}
window.updateLoop.push(updateServices);