diff --git a/light9/web/index.html b/light9/web/index.html
--- a/light9/web/index.html
+++ b/light9/web/index.html
@@ -8,10 +8,8 @@
-
-
-
-
+
+
@@ -41,32 +39,27 @@
:host > div:nth-child(3) { width: 5em; }
:host > div:nth-child(4) { width: 3em; }
:host > div:nth-child(5) { width: 50px; }
-
-
-
-
-
-
-
-
+
+
+
+
@@ -78,7 +71,7 @@
-
+
@@ -88,9 +81,10 @@
-
+
diff --git a/light9/web/stats-line.js b/light9/web/stats-line.js
--- a/light9/web/stats-line.js
+++ b/light9/web/stats-line.js
@@ -23,7 +23,14 @@ class StatsLine extends LitElement {
resp.json().then((msg) => {
this.stats = msg;
setTimeout(reload, 1000);
+ }).catch((err) => {
+ setTimeout(reload, 1000);
});
+ } else {
+ if (resp.status == 502) {
+ setTimeout(reload, 5000);
+ }
+ // 404: likely not mapped to a responding server
}
});
}
diff --git a/light9/web/stats-process.js b/light9/web/stats-process.js
--- a/light9/web/stats-process.js
+++ b/light9/web/stats-process.js
@@ -37,7 +37,7 @@ class StatsProcess extends LitElement {
// wrong type of fade- never goes to 0
ctx.fillStyle = '#00000003';
ctx.fillRect(0, 0, w, h);
- if (this.data.time < now - 2) {
+ if (!this.data || this.data.time < now - 2) {
return;
}
const dt = now - prev;