Skip to content

Commit

Permalink
Added popup notification if firmware is incompatible with webserver f…
Browse files Browse the repository at this point in the history
…iles.
  • Loading branch information
doudar committed Dec 26, 2023
1 parent 8811d1c commit 9f26289
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions data/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<body>
<fieldset><legend><a href="http://github.com/doudar/SmartSpin2k">http://github.com/doudar/SmartSpin2k</a></legend>
<h1 style="text-align: center;"><strong>SmartSpin2k</strong></h1>
<h2>
<p style="text-align: center;"><strong><a href="shift.html">Web Shifter</a></strong></p>
<p style="text-align: center;"><strong><a href="hrtowatts.html">Heartrate to Watts Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="/wifi">WiFi Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="bluetoothscanner.html">Bluetooth Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="settings.html">Advanced Settings</a></strong></p>
<p style="text-align: center;"><strong><a href="develop.html">Developer Tools</a></strong></p>
<p><a href=https://github.com/doudar/SmartSpin2k/wiki>SS2K Help</a></p>
</h2>
</fieldset>
<fieldset>
<legend><a href="http://github.com/doudar/SmartSpin2k">http://github.com/doudar/SmartSpin2k</a></legend>
<h1 style="text-align: center;"><strong>SmartSpin2k</strong></h1>
<h2>
<p style="text-align: center;"><strong><a href="shift.html">Web Shifter</a></strong></p>
<p style="text-align: center;"><strong><a href="hrtowatts.html">Heartrate to Watts Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="/wifi">WiFi Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="bluetoothscanner.html">Bluetooth Setup</a></strong></p>
<p style="text-align: center;"><strong><a href="settings.html">Advanced Settings</a></strong></p>
<p style="text-align: center;"><strong><a href="develop.html">Developer Tools</a></strong></p>
<p><a href=https://github.com/doudar/SmartSpin2k/wiki>SS2K Help</a></p>
</h2>
</fieldset>

<p style="text-align: center; color: blanchedalmond;"><label id="firmwareVersion">loading</label></p>
<p style="text-align: center; color: blanchedalmond;"><label id="firmwareVersion">loading</label></p>
</body>

<script>
//Update values on specified interval loading late because this tiny webserver hates frequent requests
setInterval(function () {
if (document.getElementById("firmwareVersion").innerHTML == "loading"){
var intTimer = setInterval(function () {
if (document.getElementById("firmwareVersion").innerHTML == "loading") {
requestConfigValues();
}

Expand All @@ -32,6 +32,11 @@ <h2>
document.getElementById("firmwareVersion").innerHTML = obj.firmwareVersion;
}
};
let color = window.getComputedStyle(document.body, null).getPropertyValue('background-color');
if (color == "rgba(0, 0, 0, 0)") {
alert("New firmware is available and your webserver files aren't compatible with this firmware. Please update your firmware manually. \n\nhttps://github.com/doudar/SmartSpin2k/wiki/Loading-Software");
clearInterval(intTimer);
}
xhttp.open("GET", "/configJSON", true);
xhttp.send();
}
Expand Down

0 comments on commit 9f26289

Please sign in to comment.