Reduce refresh of live view to 1s and fix connection status

This commit is contained in:
Peter Stockings
2023-01-26 16:00:28 +11:00
parent 693f47d784
commit f79823b785
2 changed files with 2 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ async function connect(props) {
console.log("> Characteristic value changed event listener added");
socket = io();
socket.addEventListener("open", () => {
socket.on("connect", () => {
btn.classList.remove("bg-red-600");
btn.classList.add("bg-green-600");
});

View File

@@ -29,7 +29,7 @@
</nav>
</div>
<div hx-get="{{ url_for('overview', device_id=device['id']) }}" hx-trigger="load, every 2s">
<div hx-get="{{ url_for('overview', device_id=device['id']) }}" hx-trigger="load, every 1s">
<div class="flex justify-center">
<div role="status">
<svg aria-hidden="true" class="w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"