Visualization
@@ -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"];
diff --git a/tools/esp8266/html/setup.html b/tools/esp8266/html/setup.html
index 2021a11f..1715d2bb 100644
--- a/tools/esp8266/html/setup.html
+++ b/tools/esp8266/html/setup.html
@@ -28,6 +28,7 @@
+
@@ -325,6 +326,9 @@
parseSerial(root["serial"]);
}
}
+
+ hiddenInput = document.getElementById("disclaimer")
+ hiddenInput.value = sessionStorage.getItem("gDisclaimer");
getAjax("/api/setup", parse);
diff --git a/tools/esp8266/web.cpp b/tools/esp8266/web.cpp
index 5891fbe1..40e6b4b5 100644
--- a/tools/esp8266/web.cpp
+++ b/tools/esp8266/web.cpp
@@ -258,6 +258,11 @@ void web::showSave(AsyncWebServerRequest *request) {
if(request->arg("invRetry") != "")
mConfig->maxRetransPerPyld = request->arg("invRetry").toInt();
+ // Disclaimer
+ if(request->arg("disclaimer") != "")
+ mConfig->disclaimer = strcmp("true", request->arg("disclaimer").c_str()) == 0 ? true : false;
+ DPRINTLN(DBG_INFO, request->arg("disclaimer").c_str());
+
// pinout
uint8_t pin;
for(uint8_t i = 0; i < 3; i ++) {
diff --git a/tools/esp8266/webApi.cpp b/tools/esp8266/webApi.cpp
index 020eaf37..d2a8390a 100644
--- a/tools/esp8266/webApi.cpp
+++ b/tools/esp8266/webApi.cpp
@@ -143,6 +143,7 @@ void webApi::getSystem(JsonObject obj) {
obj[F("ts_uptime")] = mApp->getUptime();
obj[F("ts_now")] = mApp->getTimestamp();
obj[F("wifi_rssi")] = WiFi.RSSI();
+ obj[F("disclaimer")] = mConfig->disclaimer;
}