Update fermata.js

This commit is contained in:
2025-08-28 15:32:30 +02:00
committed by GitHub
parent 11dc86bc9e
commit 3ecea85600

View File

@@ -15,6 +15,10 @@ function caricadati(){
const container = document.getElementById('tabella-container'); const container = document.getElementById('tabella-container');
container.innerHTML = ''; container.innerHTML = '';
fetch('https://api.vichingo455.freeddns.org/fermateapi/versione')
.then(res => res.text())
.then(versione => document.getElementById("ver").innerHTML = versione);
if (!data || data.length === 0) { if (!data || data.length === 0) {
container.innerHTML = '<h3>Nessuna linea in arrivo.</h3>'; container.innerHTML = '<h3>Nessuna linea in arrivo.</h3>';
return; return;
@@ -57,10 +61,6 @@ function caricadati(){
table.appendChild(tbody); table.appendChild(tbody);
container.appendChild(table); container.appendChild(table);
fetch('https://api.vichingo455.freeddns.org/fermateapi/versione')
.then(res => res.text())
.then(versione => document.getElementById("ver").innerHTML = versione);
}) })
.catch(err => { .catch(err => {
console.error('Errore nel caricamento dati:', err); console.error('Errore nel caricamento dati:', err);
@@ -70,4 +70,5 @@ function caricadati(){
caricadati(); caricadati();
setInterval(caricadati, 60000);
setInterval(caricadati, 60000);