diff --git a/tools/cdata.js b/tools/cdata.js index d42a392c..d01c3e35 100644 --- a/tools/cdata.js +++ b/tools/cdata.js @@ -318,12 +318,6 @@ writeChunks( method: "gzip", filter: "html-minify", }, - { - file: "settings_um2.htm", - name: "PAGE_settings_um2", - method: "gzip", - filter: "html-minify", - }, { file: "settings_pin.htm", name: "PAGE_settings_pin", diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 3f17e341..40c17616 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -1418,10 +1418,6 @@ class AudioReactive : public Usermod { sync[F("mode")] = audioSyncEnabled; } - void addToConfigMenu(JsonObject& root) { - JsonObject top = root.createNestedObject(FPSTR(_name)); - } - /* * readFromConfig() can be used to read back the custom settings you added with addToConfig(). diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm index 94dadf01..6c5a6389 100644 --- a/wled00/data/settings.htm +++ b/wled00/data/settings.htm @@ -26,6 +26,34 @@ alert("Loading of configuration script failed.\nIncomplete page data!"); }); } + function isO(i) { return (i && typeof i === 'object' && !Array.isArray(i)); } + // load settings and insert values into DOM + function ldS() { + var url = (loc?`http://${locip}`:'') + '/cfg.json'; + fetch(url, { + method: 'get' + }) + .then(res => { + if (!res.ok) gId('lserr').style.display = "inline"; + return res.json(); + }) + .then(json => { + umCfg = json.um; + urows=""; + if (isO(umCfg)) { + for (const [k,o] of Object.entries(umCfg)) { + urows += ``; + } + } + gId("configMenu").innerHTML = urows; + var url = (loc?`http://${locip}`:'') + '/settings/s.js?p=0'; + loadJS(url, false); // If we set async false, file is loaded and executed, then next statement is processed + }) + .catch((error)=>{ + gId('lserr').style.display = "inline"; + console.log(error); + }); + } function S(){ if (window.location.protocol == "file:") { loc = true; @@ -35,10 +63,8 @@ localStorage.setItem('locIp', locip); } } - var url = (loc?`http://${locip}`:'') + '/settings/s.js?p=0'; - loadJS(url, false); // If we set async false, file is loaded and executed, then next statement is processed - gId("configMenu").innerHTML = '\ - '; + //WLEDSR: add ldS and move loadJS there (like in settings_um) + ldS(); } - - -
- - - -