multiple web config

This commit is contained in:
2018-09-13 01:17:11 +02:00
parent beacbb2fb3
commit 5ffb0d32c9
3 changed files with 33 additions and 23 deletions

View File

@@ -1,22 +1,16 @@
// mesh topology:
const exampleMesh = [{
"nodeId": 757307929, "subs": [
{ "nodeId": 2138241514, "subs": [] },
{ "nodeId": 757307466, "subs": [] }
]
}, {
"nodeId": 757308244, "subs": [
{ "nodeId": 3154639577, "subs": [] }
]
}, {
"nodeId": 3954439712, "subs": []
}];
$(() => {
// load config
$.get("/config.json", (data) => {
$('.js-config').val(JSON.stringify(data, null, 4));
$('form').each((i, el) => {
let $fEl = $(el);
$.get($fEl.find('[name="fileName"]').val(), (data) => {
$fEl.find('.js-config').val(JSON.stringify(data, null, 4));
});
});
// load config
//$.get("/config.json", (data) => {
// $('.js-config').val(JSON.stringify(data, null, 4));
//});
// add handlers
$('.js-restart').click(() => {
$.post('/restart');