function sendCommand(command) {
const chiesa = document.getElementById("select-chiesa").value;
const url = `http://${chiesa}.local/${command}`;
fetch(url)
.then(res => {
if (!res.ok) throw new Error('Errore nella risposta');
alert(`Comando "${command}" inviato alla ${chiesa}`);
})
.catch(err => alert("Errore di connessione o comando non riuscito."));
}