Update index.html
This commit is contained in:
parent
ae0a59fc3b
commit
4e7e710bf5
@ -235,19 +235,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Подписываемся на обновления данных
|
// Добавляем внизу кнопку для обновления данных
|
||||||
tg.subscribeToData((data) => {
|
const container = document.querySelector(".container");
|
||||||
console.log("Обновление данных:", data);
|
const updateButton = document.createElement("button");
|
||||||
});
|
updateButton.textContent = "🔄 Обновить данные"
|
||||||
// При получении сообщения от бота обновляем страницу
|
updateButton.classList.add("button");
|
||||||
tg.subscribeToMessages((messages) => {
|
updateButton.addEventListener("click", () => {
|
||||||
console.log("Получено сообщение:", messages);
|
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
// Обновляем сайт каждые 5 секунд для получения актуальных данных
|
|
||||||
setInterval(() => {
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 5000);
|
});
|
||||||
|
container.appendChild(updateButton);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user