diff --git a/src/App.svelte b/src/App.svelte index 1f8f96c..f33e7a4 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -186,7 +186,7 @@ ]; //configuration - let config = []; + let configJson = []; let buf = []; //web sockets @@ -317,9 +317,9 @@ if (data.includes("]}")) { buf = buf.replace("]}", "]"); if (IsJsonParse(buf)) { - config = JSON.parse(buf); + configJson = JSON.parse(buf); buf = []; - config = config; + configJson = configJson; if (debug) console.log("[i]", "parsed"); } } @@ -440,7 +440,7 @@ } function clearData() { - config = []; + configJson = []; buf = []; } @@ -544,12 +544,16 @@ if (debug) console.log("[i]", "user open add params ", id); } - function pushConfigToEsp() { - //config.forEach((element) => { - wsSendMsg(wsSelected, "/changed" + JSON.stringify(config)); + function checkConfigJson() { + //configJson.forEach((element) => { + //}); + } + + function sendConfigJson() { + checkConfigJson(); + wsSendMsg(wsSelected, "/gifnoc.json" + JSON.stringify(configJson)); clearData(); sendCurrentPageName(); - //}); } function showModal() { @@ -660,7 +664,7 @@
- {#each config as element} + {#each configJson as element}