enhancement: new "config" module to access configuration in RAM

This is to allow moving some tasks/stack memory to SPIRAM, saving on
precious IRAM. HTTP server should also be more responsive.
This commit is contained in:
Sebastien
2019-11-06 23:31:13 -05:00
parent 86f0d4c7ea
commit cdbb198d8a
38 changed files with 1219 additions and 510 deletions

View File

@@ -289,14 +289,17 @@ $(document).ready(function(){
var val = $(this).val();
if (key != '') {
headers["X-Custom-"+key] = val;
data[key] = val;
data[key] = {};
data[key].value = val;
data[key].type = 33;
}
});
var key = $("#nvs-new-key").val();
var val = $("#nvs-new-value").val();
if (key != '') {
headers["X-Custom-"+key] = val;
data[key] = val;
data[key] = {};
data[key].value = val;
}
$.ajax({
url: '/config.json',
@@ -454,7 +457,7 @@ $(document).ready(function(){
//start timers
startCheckStatusInterval();
startRefreshAPInterval();
//startRefreshAPInterval();
$('[data-toggle="tooltip"]').tooltip({
html: true,
@@ -718,16 +721,16 @@ function getConfig() {
Object.keys(data).sort().forEach(function(key, i) {
if (data.hasOwnProperty(key)) {
if (key == 'autoexec') {
if (data["autoexec"] === "1") {
if (data["autoexec"].value === "1") {
$("#autoexec-cb")[0].checked=true;
} else {
$("#autoexec-cb")[0].checked=false;
}
} else if (key == 'autoexec1') {
$("textarea#autoexec1").val(data[key]);
$("textarea#autoexec1").val(data[key].value);
} else if (key == 'host_name') {
$("dhcp-name1").val(data[key]);
$("dhcp-name2").val(data[key]);
$("dhcp-name1").val(data[key].value);
$("dhcp-name2").val(data[key].value);
}
$("tbody#nvsTable").append(
@@ -738,7 +741,7 @@ function getConfig() {
"</td>"+
"</tr>"
);
$("input#"+key).val(data[key]);
$("input#"+key).val(data[key].value);
}
});
$("tbody#nvsTable").append(