This commit is contained in:
parent
bd33434cf2
commit
a971fd1828
4 changed files with 24 additions and 1 deletions
|
|
@ -3,6 +3,8 @@
|
|||
<title>succd</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png">
|
||||
<audio src="/static/button3.wav" id="button"> </audio>
|
||||
<audio src="/static/button10.wav" id="denied"> </audio>
|
||||
<style>
|
||||
body {
|
||||
font-size: 12px;
|
||||
|
|
@ -330,6 +332,21 @@ let historicalDraw = (w, h) => {
|
|||
window.addEventListener("load", (_) => {
|
||||
console.log("s u c c");
|
||||
|
||||
let dpok = false;
|
||||
for (const button of document.querySelectorAll("button")) {
|
||||
button.addEventListener("click", (event) => {
|
||||
let audio = document.querySelector('audio#button');
|
||||
|
||||
if (event.target.id === "dpon" && !dpok) {
|
||||
audio = document.querySelector('audio#denied');
|
||||
}
|
||||
|
||||
if (audio !== undefined) {
|
||||
audio.play();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let status = document.querySelector("#status");
|
||||
let failsafe = document.querySelector("#failsafe");
|
||||
let highpressure = document.querySelector("#highpressure");
|
||||
|
|
@ -397,9 +414,11 @@ window.addEventListener("load", (_) => {
|
|||
if (data.Safety.HighPressure) {
|
||||
highpressure.innerHTML = "ON";
|
||||
highpressure.style = colors.default;
|
||||
dpok = false;
|
||||
} else {
|
||||
highpressure.innerHTML = "OFF";
|
||||
highpressure.style = colors.default;
|
||||
dpok = true;
|
||||
}
|
||||
if (data.Pumps.RPOn) {
|
||||
rp.innerHTML = "ON";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue