mirror of
https://github.com/wled/WLED.git
synced 2025-04-24 14:57:18 +00:00
parent
a2368a75f7
commit
a4384bd340
@ -1227,7 +1227,6 @@ TD .checkmark, TD .radiomark {
|
||||
text-align: left;
|
||||
transition: background-color .5s;
|
||||
border-radius: 21px;
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
.seg {
|
||||
@ -1291,6 +1290,7 @@ TD .checkmark, TD .radiomark {
|
||||
margin: 0 auto 12px;
|
||||
min-height: 40px;
|
||||
border: 1px solid var(--c-2);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Simplify segments */
|
||||
@ -1421,7 +1421,6 @@ dialog {
|
||||
.presin {
|
||||
padding: 8px;
|
||||
position: relative;
|
||||
width: calc(100% - 16px);
|
||||
}
|
||||
|
||||
.btn-s,
|
||||
|
@ -618,7 +618,7 @@ function populatePresets(fromls)
|
||||
|
||||
cn += `<div class="pres lstI" id="p${i}o">`;
|
||||
if (cfg.comp.pid) cn += `<div class="pid">${i}</div>`;
|
||||
cn += `<div class="pname lstIname" onclick="setPreset(${i})">${isPlaylist(i)?"<i class='icons btn-icon'></i>":""}${pName(i)}
|
||||
cn += `<div class="pname lstIname" onclick="setPreset(${i})">${i==lastinfo.leds.bootps?"<i class='icons btn-icon'></i>":""}${isPlaylist(i)?"<i class='icons btn-icon'></i>":""}${pName(i)}
|
||||
<i class="icons edit-icon flr" id="p${i}nedit" onclick="tglSegn(${i+100})"></i></div>
|
||||
<i class="icons e-icon flr" id="sege${i+100}" onclick="expand(${i+100})"></i>
|
||||
<div class="presin lstIcontent" id="seg${i+100}"></div>
|
||||
@ -1959,6 +1959,7 @@ function plR(p)
|
||||
function makeP(i,pl)
|
||||
{
|
||||
var content = "";
|
||||
const bps = lastinfo.leds.bootps;
|
||||
if (pl) {
|
||||
if (i===0) plJson[0] = {
|
||||
ps: [1],
|
||||
@ -2024,6 +2025,11 @@ ${makePlSel(plJson[i].end?plJson[i].end:0, true)}
|
||||
</div>
|
||||
<div class="po2" id="p${i}o2">API command<br><textarea class="apitxt" id="p${i}api"></textarea></div>
|
||||
<div class="po1" id="p${i}o1">${content}</div>
|
||||
<label class="check revchkl">
|
||||
<span class="lstIname">Apply at boot</span>
|
||||
<input type="checkbox" id="p${i}bps" ${i==bps?"checked":""}>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<div class="c m6">Save to ID <input id="p${i}id" type="number" oninput="checkUsed(${i})" max=250 min=1 value=${(i>0)?i:getLowestUnusedP()}></div>
|
||||
<div class="c">
|
||||
<button class="btn btn-p" onclick="saveP(${i},${pl})"><i class="icons btn-icon"></i>Save</button>
|
||||
@ -2445,8 +2451,9 @@ function saveP(i,pl)
|
||||
if (gId(`p${i}lmp`) && gId(`p${i}lmp`).value!=="") obj.ledmap = parseInt(gId(`p${i}lmp`).value);
|
||||
}
|
||||
}
|
||||
|
||||
obj.psave = pI; obj.n = pN;
|
||||
if (gId(`p${i}bps`).checked) obj.bootps = pI;
|
||||
obj.psave = pI;
|
||||
obj.n = pN;
|
||||
var pQN = gId(`p${i}ql`).value;
|
||||
if (pQN.length > 0) obj.ql = pQN;
|
||||
|
||||
|
@ -628,6 +628,7 @@ void serializeInfo(JsonObject root)
|
||||
leds[F("maxseg")] = strip.getMaxSegments();
|
||||
//leds[F("actseg")] = strip.getActiveSegmentsNum();
|
||||
//leds[F("seglock")] = false; //might be used in the future to prevent modifications to segment config
|
||||
leds[F("bootps")] = bootPreset;
|
||||
|
||||
#ifndef WLED_DISABLE_2D
|
||||
if (strip.isMatrix) {
|
||||
|
@ -224,6 +224,13 @@ void savePreset(byte index, const char* pname, JsonObject sObj)
|
||||
if (sObj[F("ql")].is<const char*>()) strlcpy(quickLoad, sObj[F("ql")].as<const char*>(), 9); // client limits QL to 2 chars, buffer for 8 bytes to allow unicode
|
||||
else quickLoad[0] = 0;
|
||||
|
||||
const char *bootPS = PSTR("bootps");
|
||||
if (!sObj[FPSTR(bootPS)].isNull()) {
|
||||
bootPreset = sObj[FPSTR(bootPS)] | bootPreset;
|
||||
sObj.remove(FPSTR(bootPS));
|
||||
doSerializeConfig = true;
|
||||
}
|
||||
|
||||
if (sObj.size()==0 || sObj["o"].isNull()) { // no "o" means not a playlist or custom API call, saving of state is async (not immediately)
|
||||
includeBri = sObj["ib"].as<bool>() || sObj.size()==0 || index==255; // temporary preset needs brightness
|
||||
segBounds = sObj["sb"].as<bool>() || sObj.size()==0 || index==255; // temporary preset needs bounds
|
||||
|
Loading…
x
Reference in New Issue
Block a user