diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm
index 3032959d..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,8 +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
+ //WLEDSR: add ldS and move loadJS there (like in settings_um)
+ ldS();
}