2023-10-16 01:35:06 +02:00
|
|
|
const SERVICE_BLACKLIST = [
|
|
|
|
'ixvd.net',
|
|
|
|
'proxy',
|
|
|
|
'2d.neo.ixvd.net',
|
|
|
|
'pad.sandbox.neo.ixvd.net',
|
|
|
|
];
|
|
|
|
|
|
|
|
const serviceHolderDiv = document.querySelector('#service-holder');
|
|
|
|
|
|
|
|
async function update() {
|
|
|
|
serviceHolderDiv.innerHTML = 'Loading...';
|
2023-10-16 01:36:01 +02:00
|
|
|
let fetchResult = await (await fetch('/relay/gatus')).json()
|
2023-10-16 01:35:06 +02:00
|
|
|
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 = `
|
|
|
|
<span class="service-name"><a href="https://${service.hostname}" target="_blank" style="color: #de4aff">${service.hostname}</a></span>
|
|
|
|
<span class="service-status"><b style="color: ${service.success ? '#4f4' : 'red'}">${service.success ? 'Online' : 'Offline'}</b></span>
|
|
|
|
`;
|
|
|
|
serviceHolderDiv.appendChild(serviceDiv);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
update();
|