Added download of html via ota function

This commit is contained in:
Magnus
2021-03-28 08:47:37 +02:00
parent 230955d456
commit f56ef0c56f
19 changed files with 54 additions and 16 deletions

View File

@ -138,11 +138,17 @@
<form action="/api/config/push" method="post">
<input type="text" name="id" id="id2" hidden>
<div class="form-group row">
<label for="http-push" class="col-sm-4 col-form-label">Http:</label>
<label for="http-push" class="col-sm-4 col-form-label">Http 1:</label>
<div class="col-sm-8">
<input type="url" maxlength="90" class="form-control" name="http-push" id="http-push">
</div>
</div>
<div class="form-group row">
<label for="http-push2" class="col-sm-4 col-form-label">Http 2:</label>
<div class="col-sm-8">
<input type="url" maxlength="90" class="form-control" name="http-push2" id="http-push2">
</div>
</div>
<div class="form-group row">
<label for="inputBrewfatherPush" class="col-sm-4 col-form-label">Brewfather:</label>
<div class="col-sm-8">
@ -302,6 +308,7 @@
$("#temp-format-f").click();
$("#ota-url").val(cfg["ota-url"]);
$("#http-push").val(cfg["http-push"]);
$("#http-push2").val(cfg["http-push2"]);
$("#brewfather-push").val(cfg["brewfather-push"]);
$("#push-interval").val(cfg["push-interval"]);
$("#voltage-factor").val(cfg["voltage-factor"]);

File diff suppressed because one or more lines are too long

View File

@ -118,7 +118,7 @@
$('#spinner').show();
$.getJSON(url, function (cfg) {
console.log( cfg );
$("#app-ver").text(cfg["app-ver"]);
$("#app-ver").text(cfg["app-ver"] + " (html 0.2.1)");
$("#mdns").text(cfg["mdns"]);
$("#id").text(cfg["id"]);
})

View File

@ -14,4 +14,4 @@
<button type="button" class="btn btn-warning" id="wifi-reset-btn">Factory default settings</button>
</div>
</div>
--><hr class="my-4"></div><script type="text/javascript">function getConfig(){var n="/api/device";$("#spinner").show(),$.getJSON(n,function(n){console.log(n),$("#app-ver").text(n["app-ver"]),$("#mdns").text(n.mdns),$("#id").text(n.id)}).fail(function(){showError("Unable to get data from the device.")}).always(function(){$("#spinner").hide()})}window.onload=getConfig</script><!-- START FOOTER --><div class="container-fluid themed-container bg-primary text-light">(C) Copyright 2021 Magnus Persson</div></body></html>
--><hr class="my-4"></div><script type="text/javascript">function getConfig(){var n="/api/device";$("#spinner").show(),$.getJSON(n,function(n){console.log(n),$("#app-ver").text(n["app-ver"]+" (html 0.2.1)"),$("#mdns").text(n.mdns),$("#id").text(n.id)}).fail(function(){showError("Unable to get data from the device.")}).always(function(){$("#spinner").hide()})}window.onload=getConfig</script><!-- START FOOTER --><div class="container-fluid themed-container bg-primary text-light">(C) Copyright 2021 Magnus Persson</div></body></html>