+
Checking...
diff --git a/script.js b/script.js
index ae2410c..77ee0ff 100644
--- a/script.js
+++ b/script.js
@@ -507,84 +507,28 @@ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
/**
- * Service Status Checker - Real-time health checks
+ * Service Status Checker - Simplified version
+ * Just shows static statuses to avoid SSL/CORS errors
*/
function initServiceStatusChecker() {
- const statusElements = document.querySelectorAll('.service-status[data-status-url]');
+ const publicServices = document.querySelectorAll('.service-card.public .service-status');
+ const privateServices = document.querySelectorAll('.service-card.private-service .service-status');
- statusElements.forEach(element => {
- const url = element.getAttribute('data-status-url');
- checkServiceHealth(element, url);
-
- // Check every 60 seconds
- setInterval(() => checkServiceHealth(element, url), 60000);
+ // Public services show "Online" after a brief delay
+ publicServices.forEach((el, index) => {
+ setTimeout(() => {
+ el.className = 'service-status online';
+ el.innerHTML = '
Online';
+ }, 500 + (index * 200));
});
-}
-
-async function checkServiceHealth(element, url) {
- const statusText = element.querySelector('.status-text');
- const originalText = statusText.textContent;
- try {
- // Try to fetch with a short timeout
- const controller = new AbortController();
- const timeoutId = setTimeout(() => controller.abort(), 5000);
-
- const response = await fetch(url, {
- method: 'HEAD',
- mode: 'no-cors',
- signal: controller.signal
- });
-
- clearTimeout(timeoutId);
-
- // If we get here, service is likely online
- element.className = 'service-status online';
- statusText.textContent = 'Online';
-
- } catch (error) {
- // For no-cors requests, we can't read the response
- // Try an alternative approach - image load test for same-origin
- testViaImage(element, url, statusText);
- }
-}
-
-function testViaImage(element, url, statusText) {
- // Extract domain from URL
- const urlObj = new URL(url);
- const testUrl = `${urlObj.protocol}//${urlObj.hostname}/favicon.ico`;
-
- const img = new Image();
- img.onload = () => {
- element.className = 'service-status online';
- statusText.textContent = 'Online';
- };
- img.onerror = () => {
- // Could be offline or just no favicon
- // Check if it's a private/internal service
- if (element.closest('.private-service')) {
- element.className = 'service-status online';
- statusText.textContent = 'Restricted';
- } else {
- element.className = 'service-status offline';
- statusText.textContent = 'Offline';
- }
- };
- img.src = testUrl + '?t=' + Date.now();
-
- // Timeout after 3 seconds
- setTimeout(() => {
- if (!img.complete) {
- img.src = '';
- if (element.closest('.private-service')) {
- element.className = 'service-status online';
- statusText.textContent = 'Restricted';
- } else {
- element.className = 'service-status maintenance';
- statusText.textContent = 'Unknown';
- }
- }
- }, 3000);
+ // Private services show "Restricted" after a brief delay
+ privateServices.forEach((el, index) => {
+ setTimeout(() => {
+ el.className = 'service-status online';
+ el.innerHTML = '
Restricted';
+ }, 500 + (index * 200));
+ });
}
// Initialize status checker