Update README.md, colors.txt, config.sh, and 10 more files for alpha v0.3
This commit is contained in:
parent
a08a86dc40
commit
6d9651b4ff
13 changed files with 449 additions and 109 deletions
|
|
@ -5,5 +5,41 @@
|
|||
|
||||
<a href="#" id="scrollToTopBtn" class="scroll-to-top-btn" title="Nach oben scrollen">▲</a>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const statusBadges = document.querySelectorAll('.online-status-badge[data-status-url]');
|
||||
|
||||
if (statusBadges.length > 0) {
|
||||
statusBadges.forEach(badge => {
|
||||
const url = badge.dataset.statusUrl + '?v=' + new Date().getTime();
|
||||
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok for ' + url);
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(text => {
|
||||
badge.classList.remove('unknown');
|
||||
if (text.trim().startsWith('online')) {
|
||||
badge.textContent = 'online';
|
||||
badge.classList.add('online');
|
||||
} else {
|
||||
badge.textContent = 'offline';
|
||||
badge.classList.add('offline');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fehler beim Abrufen des Welt-Status:', error);
|
||||
badge.textContent = 'n.a.'; // Nicht verfügbar
|
||||
badge.classList.remove('unknown');
|
||||
badge.classList.add('offline'); // Bei Fehler als offline markieren
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue