mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-16 16:36:59 +03:00
config.ini editor
This commit is contained in:
@@ -13,9 +13,9 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
|
|||||||
|
|
||||||
## Change log - latest version
|
## Change log - latest version
|
||||||
|
|
||||||
##### Rolling (2020-08-15)
|
##### Rolling (2020-08-17)
|
||||||
|
|
||||||
* Nightly updates (bug fixing)
|
* Only editor for config.ini
|
||||||
|
|
||||||
* Implementation of Digital Consistency Check: check if Digit shows next number earlier, than previous number has gone through zero - Turn on/off - see updated config.ini `CheckDigitIncreaseConsistency = True`)
|
* Implementation of Digital Consistency Check: check if Digit shows next number earlier, than previous number has gone through zero - Turn on/off - see updated config.ini `CheckDigitIncreaseConsistency = True`)
|
||||||
Not fully tested!
|
Not fully tested!
|
||||||
|
|||||||
82
sd-card/html/edit_config.html
Normal file
82
sd-card/html/edit_config.html
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td>Config.ini:</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
<textarea id="inputTextToSave" cols="80" rows="25"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><button onclick="saveTextAsFile()">Update Config.ini</button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function loadConfig() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onload = function () {
|
||||||
|
// alert(this.responseText);
|
||||||
|
document.getElementById("inputTextToSave").value = this.responseText;
|
||||||
|
};
|
||||||
|
url = '/fileserver/config/config.ini';
|
||||||
|
xhr.open('GET', url);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function saveTextAsFile()
|
||||||
|
{
|
||||||
|
if (confirm("Are you sure you want to update \"config.ini\"?")) {
|
||||||
|
var xhttp = new XMLHttpRequest();
|
||||||
|
|
||||||
|
/* first delete the old firmware */
|
||||||
|
xhttp.onreadystatechange = function() {
|
||||||
|
if (xhttp.readyState == 4) {
|
||||||
|
if (xhttp.status == 200) {
|
||||||
|
/* keine Reaktion, damit sich das Dokument nicht ändert */
|
||||||
|
} else if (xhttp.status == 0) {
|
||||||
|
alert("Server closed the connection abruptly!");
|
||||||
|
location.reload()
|
||||||
|
} else {
|
||||||
|
alert(xhttp.status + " Error!\n" + xhttp.responseText);
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhttp.open("POST", "/delete/config/config.ini", false);
|
||||||
|
xhttp.send();
|
||||||
|
/* ----------------------------- */
|
||||||
|
|
||||||
|
var textToSave = document.getElementById("inputTextToSave").value;
|
||||||
|
|
||||||
|
xhttp.onreadystatechange = function() {
|
||||||
|
if (xhttp.readyState == 4) {
|
||||||
|
if (xhttp.status == 200) {
|
||||||
|
alert("Update \"config.ini\" successfull!\n\nTo make it active you need to reboot.")
|
||||||
|
document.reload();
|
||||||
|
} else if (xhttp.status == 0) {
|
||||||
|
alert("Server closed the connection abruptly!");
|
||||||
|
location.reload()
|
||||||
|
} else {
|
||||||
|
alert(xhttp.status + " Error!\n" + xhttp.responseText);
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
upload_path = "/upload/config/config.ini";
|
||||||
|
|
||||||
|
xhttp.open("POST", upload_path, true);
|
||||||
|
xhttp.send(textToSave);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadConfig();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -84,6 +84,7 @@
|
|||||||
<li aria-current="page"><a href="#"onclick="document.getElementById('maincontent').src = '/wasserzaehler_roi.html';">wasserzaehler</a>
|
<li aria-current="page"><a href="#"onclick="document.getElementById('maincontent').src = '/wasserzaehler_roi.html';">wasserzaehler</a>
|
||||||
<ul class="submenu">
|
<ul class="submenu">
|
||||||
<li><a href="#"onclick="document.getElementById('maincontent').src = '/prevalue_set.html';">PreValue</a> </li>
|
<li><a href="#"onclick="document.getElementById('maincontent').src = '/prevalue_set.html';">PreValue</a> </li>
|
||||||
|
<li><a href="#"onclick="document.getElementById('maincontent').src = '/edit_config.html';">Edit Configuration</a> </li>
|
||||||
<li><a href="#"onclick="document.getElementById('maincontent').src = '/wasserzaehler.html?full';">wasserzaehler full</a> </li>
|
<li><a href="#"onclick="document.getElementById('maincontent').src = '/wasserzaehler.html?full';">wasserzaehler full</a> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user