succd: add safety status to web frontend
This commit is contained in:
parent
eb7707f1a0
commit
908727608a
3 changed files with 65 additions and 24 deletions
|
@ -94,6 +94,14 @@ td > span {
|
|||
<th>Status</th>
|
||||
<td id="status" colspan="4">OK</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Failsafe</th>
|
||||
<td id="failsafe" colspan="4">OK</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Diffusion Pump Lockout</th>
|
||||
<td id="highpressure" colspan="4">OK</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<p style="margin-top: 2em;">
|
||||
|
@ -240,6 +248,8 @@ window.addEventListener("load", (_) => {
|
|||
console.log("s u c c");
|
||||
|
||||
let status = document.querySelector("#status");
|
||||
let failsafe = document.querySelector("#failsafe");
|
||||
let highpressure = document.querySelector("#highpressure");
|
||||
let volts = document.querySelector("#volts");
|
||||
let mbar = document.querySelector("#mbar");
|
||||
let ping = document.querySelector("#ping");
|
||||
|
@ -280,6 +290,21 @@ window.addEventListener("load", (_) => {
|
|||
const data = JSON.parse(event.data);
|
||||
volts.innerHTML = data.Volts;
|
||||
mbar.innerHTML = data.Mbar;
|
||||
failsafe.innerHTML = data.failsafe ? "ON" : "OFF";
|
||||
if data.failsafe {
|
||||
failsafe.innerHTML = "ON"";
|
||||
failsafe.style = "background-color: #f06060";
|
||||
} else {
|
||||
failsafe.innerHTML = "OFF";
|
||||
failsafe.style = "background-color: #60f060";
|
||||
}
|
||||
if data.highpressure {
|
||||
highpressure.innerHTML = "ON";
|
||||
highpressure.style = "background-color: #f06060";
|
||||
} else {
|
||||
highpressure.innerHTML = "OFF";
|
||||
highpressure.style = "background-color: #60f060";
|
||||
}
|
||||
rp.innerHTML = data.RPOn ? "ON" : "OFF";
|
||||
if (data.RPOn) {
|
||||
rp.style = "background-color: #60f060";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue