Minor UI tweaks.

Added WS reconnects.
This commit is contained in:
Blaz Kristan 2021-07-04 12:09:19 +02:00
parent 3066a142b8
commit de8a244500
4 changed files with 2254 additions and 2246 deletions

View File

@ -330,7 +330,7 @@ button {
} }
.first { .first {
margin-top: 18px !important; margin-top: 10px;
} }
#toast { #toast {
@ -603,6 +603,9 @@ input[type=range]::-moz-range-thumb {
width: 42px; width: 42px;
height: 42px; height: 42px;
} }
.btn-xs {
margin: 2px 0 0 0;
}
.btn-pl-del, .btn-pl-add { .btn-pl-del, .btn-pl-add {
margin: 0; margin: 0;
white-space: nowrap; white-space: nowrap;
@ -642,6 +645,7 @@ input[type=range]::-moz-range-thumb {
} }
.sel-pl { .sel-pl {
width: 165px; width: 165px;
background-position: 141px 16px;
} }
.sel-ple { .sel-ple {
width: 100%; width: 100%;
@ -693,10 +697,6 @@ input[type=text] {
margin: 6px !important; margin: 6px !important;
} }
.plentry {
position: relative;
}
.stxt { .stxt {
width: 50px !important; width: 50px !important;
} }
@ -1089,13 +1089,9 @@ input[type="text"].fnd:not(:placeholder-shown) {
.hrz { .hrz {
width: auto; width: auto;
height: 2px; height: 2px;
background-color: var(--c-e); background-color: var(--c-b);
margin: 3px 0; margin: 3px 0;
} }
.hrz-pl {
margin: 20px 0;
position: relative;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 6px;

View File

@ -405,8 +405,11 @@ function loadPresets(callback = null)
return res.json(); return res.json();
}) })
.then(json => { .then(json => {
clearErrorToast();
pJson = json; pJson = json;
populatePresets(); populatePresets();
// Create UI update WS handler
if (!ws && lastinfo.ws > -1) setTimeout(makeWS,1000);
if (callback) callback(); if (callback) callback();
}) })
.catch(function (error) { .catch(function (error) {
@ -429,9 +432,11 @@ function loadPalettes(callback = null)
return res.json(); return res.json();
}) })
.then(json => { .then(json => {
clearErrorToast();
lJson = Object.entries(json); lJson = Object.entries(json);
populatePalettes(); populatePalettes();
// updateUI(); // Create UI update WS handler
if (!ws && lastinfo.ws > -1) setTimeout(makeWS,1000);
if (callback) callback(); if (callback) callback();
}) })
.catch(function (error) { .catch(function (error) {
@ -655,7 +660,7 @@ function populateSegments(s)
<tr> <tr>
<td><input class="noslide segn" id="seg${i}s" type="number" min="0" max="${ledCount-1}" value="${inst.start}" oninput="updateLen(${i})"></td> <td><input class="noslide segn" id="seg${i}s" type="number" min="0" max="${ledCount-1}" value="${inst.start}" oninput="updateLen(${i})"></td>
<td><input class="noslide segn" id="seg${i}e" type="number" min="0" max="${ledCount-(cfg.comp.seglen?inst.start:0)}" value="${inst.stop-(cfg.comp.seglen?inst.start:0)}" oninput="updateLen(${i})"></td> <td><input class="noslide segn" id="seg${i}e" type="number" min="0" max="${ledCount-(cfg.comp.seglen?inst.start:0)}" value="${inst.stop-(cfg.comp.seglen?inst.start:0)}" oninput="updateLen(${i})"></td>
<td><input class="noslide segn" id="seg${i}of" type="number" min="0" max="${ledCount-1}" value="${inst.of}" oninput="updateLen(${i})"></td> <td><input class="noslide segn" id="seg${i}of" type="number" value="${inst.of}" oninput="updateLen(${i})"></td>
</tr> </tr>
</table> </table>
<table class="infot segt"> <table class="infot segt">
@ -755,7 +760,10 @@ function loadNodes()
return res.json(); return res.json();
}) })
.then(json => { .then(json => {
clearErrorToast();
populateNodes(lastinfo, json); populateNodes(lastinfo, json);
// Create UI update WS handler
if (!ws && lastinfo.ws > -1) setTimeout(makeWS,1000);
}) })
.catch(function (error) { .catch(function (error) {
showToast(error, true); showToast(error, true);
@ -1201,6 +1209,8 @@ function requestJson(command, rinfo = true, verbose = true, callback = null)
var s = json.state ? json.state : json; var s = json.state ? json.state : json;
readState(s); readState(s);
reqsLegal = true; reqsLegal = true;
// Create UI update WS handler
if (!ws && lastinfo.ws > -1) setTimeout(makeWS,1000);
if (callback) callback(); if (callback) callback();
}) })
.catch(function (error) { .catch(function (error) {
@ -1325,7 +1335,7 @@ function makePlSel(arr) {
function refreshPlE(p) { function refreshPlE(p) {
var plEDiv = gId(`ple${p}`); var plEDiv = gId(`ple${p}`);
if (!plEDiv) return; if (!plEDiv) return;
var content = "<div class=\"c\">Playlist entries</div>"; var content = "<div class=\"first c\">Playlist entries</div>";
for (var i = 0; i < plJson[p].ps.length; i++) { for (var i = 0; i < plJson[p].ps.length; i++) {
content += makePlEntry(p,i); content += makePlEntry(p,i);
} }

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2107031 #define VERSION 2107041
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG