diff --git a/popup.js b/popup.js index 6e53e6e..acedb21 100644 --- a/popup.js +++ b/popup.js @@ -1,26 +1,26 @@ -document.addEventListener('DOMContentLoaded', function () { - checkServerStatus("https://windelweb.org", "status-windelweb"); - checkServerStatus("https://app.windelgeschichten.org", "status-app-windelgeschichten"); - checkServerStatus("https://www.windelgeschichten.org", "status-windelgeschichten"); - checkServerStatus("https://windelweb.org/Helpdesk/", "status-m-viper"); - }); - - function checkServerStatus(url, statusElementId) { - fetch(url) - .then(response => { - var statusElement = document.getElementById(statusElementId); - if (response.status === 200) { - statusElement.textContent = 'Online'; - statusElement.style.color = '#00FF00'; // Grün für online - } else { - statusElement.textContent = 'Offline'; - statusElement.style.color = '#FF0000'; // Rot für offline - } - }) - .catch(error => { - var statusElement = document.getElementById(statusElementId); - statusElement.textContent = 'Offline'; - statusElement.style.color = '#FF0000'; // Rot für offline - }); - } +document.addEventListener('DOMContentLoaded', function () { + checkServerStatus("https://example-1.com", "Server-1"); + checkServerStatus("https://example-2.com", "Server-2"); + checkServerStatus("https://example-3.com", "Server-3"); + checkServerStatus("https://example-4.com", "Server-4"); + }); + + function checkServerStatus(url, statusElementId) { + fetch(url) + .then(response => { + var statusElement = document.getElementById(statusElementId); + if (response.status === 200) { + statusElement.textContent = 'Online'; + statusElement.style.color = '#00FF00'; // Grün für online + } else { + statusElement.textContent = 'Offline'; + statusElement.style.color = '#FF0000'; // Rot für offline + } + }) + .catch(error => { + var statusElement = document.getElementById(statusElementId); + statusElement.textContent = 'Offline'; + statusElement.style.color = '#FF0000'; // Rot für offline + }); + } \ No newline at end of file