diff --git a/options.js b/options.js new file mode 100644 index 0000000..882cfe4 --- /dev/null +++ b/options.js @@ -0,0 +1,25 @@ +document.addEventListener('DOMContentLoaded', function () { + // Elemente aus dem DOM auswählen + const serverUrlInput = document.getElementById('server-url'); + const addServerButton = document.getElementById('add-server'); + const serverList = document.getElementById('server-list'); + + // Hinzufügen eines Servers beim Klicken auf den "Hinzufügen"-Button + addServerButton.addEventListener('click', function () { + const serverUrl = serverUrlInput.value; + if (serverUrl) { + const listItem = document.createElement('li'); + listItem.textContent = serverUrl; + serverList.appendChild(listItem); + + // Hier können Sie den ServerUrl speichern oder an eine Backend-API senden + // um die Server für die Überwachung in der Erweiterung zu verwenden + chrome.storage.local.get({ serverUrls: [] }, function (data) { + const serverUrls = data.serverUrls; + serverUrls.push(serverUrl); + chrome.storage.local.set({ serverUrls: serverUrls }); + }); + } + }); + }); + \ No newline at end of file diff --git a/popup.css b/popup.css new file mode 100644 index 0000000..663e750 --- /dev/null +++ b/popup.css @@ -0,0 +1,49 @@ +body { + width: 400px; + text-align: center; + font-family: Arial, sans-serif; + background-image: url('bg.png'); + background-size: cover; + background-repeat: no-repeat; + background-position: center; + padding: 20px; + background-color: rgba(10, 10, 10, 0.8); + } + + .server-status { + background-color: rgba(255, 255, 255, 0.8); + border-radius: 10px; + padding: 20px; + box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.5); + text-align: center; + } + + .server-status h1 { + font-size: 24px; + color: #333; + margin-bottom: 20px; + } + + .server-box { + background-color: rgba(255, 255, 255, 0.9); + border-radius: 10px; + padding: 10px; + margin: 10px 0; + box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3); + } + + .server-box h2 { + font-size: 16px; + color: #333; + margin: 5px 0; + } + + .server-box #status-windelweb, + .server-box #status-app-windelgeschichten, + .server-box #status-windelgeschichten, + .server-box #status-m-viper { + font-size: 14px; + font-weight: bold; + margin: 5px 0; + } + \ No newline at end of file diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..30530af --- /dev/null +++ b/popup.html @@ -0,0 +1,29 @@ + + + + Server Status + + + + +
+

Server Status

+
+

Windelweb

+
Loading...
+
+
+

App Windelgeschichten

+
Loading...
+
+
+

Windelgeschichten

+
Loading...
+
+
+

M-Viper

+
Loading...
+
+
+ + diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..6e53e6e --- /dev/null +++ b/popup.js @@ -0,0 +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 + }); + } + \ No newline at end of file