Add disclaimer to the Ahoy

This commit is contained in:
DanielR92 2022-10-18 21:25:15 +02:00
parent f2a794d518
commit 86b3137b6a
6 changed files with 36 additions and 1 deletions

View file

@ -9,6 +9,21 @@
<body>
<h1>AHOY</h1>
<div id="content" class="content">
<SCRIPT>
function promptFunction() {
var Text = prompt("This project was started from https://www.mikrocontroller.net/topic/525778 this discussion.\n\n" +
"The Hoymiles protocol was decrypted through the voluntary efforts of many participants. ahoy, among others, was developed based on this work. The project is licensed under an Open Source " +
"License (https://github.com/lumapu/ahoy/blob/main/LICENSE) GNU General Public License v3.0.\n\n" +
"The software was developed to the best of our knowledge and belief. Nevertheless, no liability can be accepted for a malfunction or guarantee loss of the inverter.\n\n" +
"Ahoy is freely available. If you paid money for the software, you probably got ripped off.\n\nPlease type in 'YeS', you are accept our Disclaim.", "");
if (Text != "YeS")
promptFunction();
else
return true;
}
</SCRIPT>
<p>
<a href="/live">Visualization</a><br/>
<br/>
@ -68,6 +83,9 @@
}
function parseSys(obj) {
// Disclaimer
if(obj["disclaimer"] == false) sessionStorage.setItem("gDisclaimer", promptFunction());
document.getElementById("version").innerHTML = "Git SHA: " + obj["build"] + " :: " + obj["version"];
document.getElementById("wifi_rssi").innerHTML = obj["wifi_rssi"];

View file

@ -28,6 +28,7 @@
<legend class="des">Device Host Name</legend>
<label for="device">Device Name</label>
<input type="text" name="device" class="text"/>
<input type="hidden" name="disclaimer" value="false" id="disclaimer">
</fieldset>
<button type="button" class="s_collapsible">WiFi</button>
@ -325,6 +326,9 @@
parseSerial(root["serial"]);
}
}
hiddenInput = document.getElementById("disclaimer")
hiddenInput.value = sessionStorage.getItem("gDisclaimer");
getAjax("/api/setup", parse);
</script>