Restore corrupt presets from backup
This commit is contained in:
parent
b4aec91d67
commit
9929c96650
@ -426,18 +426,29 @@ function presetError(empty)
|
|||||||
if (hasBackup) {
|
if (hasBackup) {
|
||||||
cn += `<br><br>`;
|
cn += `<br><br>`;
|
||||||
if (empty)
|
if (empty)
|
||||||
cn += `However, there is backup preset data of a previous installation available.<br>
|
cn += `However, there is backup preset data of a previous installation available.<br>(Saving a preset will hide this and overwrite the backup)`;
|
||||||
(Saving a preset will hide this and overwrite the backup)`;
|
|
||||||
else
|
else
|
||||||
cn += `Here is a backup of the last known good state:`;
|
cn += `Here is a backup of the last known good state:`;
|
||||||
cn += `<textarea id="bck"></textarea><br>
|
cn += `<textarea id="bck"></textarea><br><button class="btn" onclick="cpBck()">Copy to clipboard</button>`;
|
||||||
<button class="btn" onclick="cpBck()">Copy to clipboard</button>`;
|
cn += `<button type="button" class="btn" onclick="saveBackup(gID('bck').value)">Restore</button>`;
|
||||||
}
|
}
|
||||||
cn += `</div>`;
|
cn += `</div>`;
|
||||||
gId('pcont').innerHTML = cn;
|
gId('pcont').innerHTML = cn;
|
||||||
if (hasBackup) gId('bck').value = bckstr;
|
if (hasBackup) gId('bck').value = bckstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveBackup(txt) {
|
||||||
|
var req = new XMLHttpRequest();
|
||||||
|
req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)});
|
||||||
|
req.addEventListener('error', function(e){showToast(e.stack,true);});
|
||||||
|
req.open("POST", getURL("/upload"));
|
||||||
|
var formData = new FormData();
|
||||||
|
var b = new Blob([txt], {type: "application/json"});
|
||||||
|
formData.append("data", b, '/presets.json');
|
||||||
|
req.send(formData);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function loadPresets(callback = null)
|
function loadPresets(callback = null)
|
||||||
{
|
{
|
||||||
// 1st boot (because there is a callback)
|
// 1st boot (because there is a callback)
|
||||||
|
@ -44,44 +44,44 @@ const char PAGE_dmxmap[] PROGMEM = R"=====()=====";
|
|||||||
const uint16_t PAGE_update_length = 616;
|
const uint16_t PAGE_update_length = 616;
|
||||||
const uint8_t PAGE_update[] PROGMEM = {
|
const uint8_t PAGE_update[] PROGMEM = {
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x75, 0x53, 0x5d, 0x6f, 0xd4, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x75, 0x53, 0x5d, 0x6f, 0xd4, 0x30,
|
||||||
0x10, 0x7c, 0xcf, 0xaf, 0x30, 0x7e, 0xba, 0x93, 0x38, 0xbb, 0x20, 0x78, 0xa0, 0x24, 0x29, 0x94,
|
0x10, 0x7c, 0xcf, 0xaf, 0x70, 0xfd, 0x74, 0x27, 0x71, 0x76, 0x41, 0xe2, 0x81, 0x92, 0xa4, 0x50,
|
||||||
0x56, 0xa8, 0x12, 0x52, 0x2b, 0xb5, 0x05, 0xf1, 0x84, 0x1c, 0x7b, 0x73, 0x31, 0xe7, 0xd8, 0xa9,
|
0x5a, 0xa1, 0x4a, 0x48, 0xad, 0xd4, 0x16, 0xc4, 0x13, 0x72, 0xec, 0xcd, 0xc5, 0x9c, 0x63, 0xa7,
|
||||||
0xbd, 0xb9, 0xd3, 0x09, 0xf5, 0xbf, 0xb3, 0x71, 0xee, 0x0a, 0xe2, 0xe3, 0x25, 0x8a, 0xb3, 0xb3,
|
0xf6, 0xe6, 0x4e, 0x27, 0xd4, 0xff, 0xce, 0xc6, 0xb9, 0x2b, 0x88, 0x8f, 0x97, 0x28, 0xce, 0xce,
|
||||||
0xe3, 0xdd, 0x99, 0x49, 0xf9, 0xec, 0xe2, 0xfa, 0xc3, 0xdd, 0xd7, 0x9b, 0x4b, 0xd6, 0x61, 0xef,
|
0x8e, 0x77, 0x67, 0x26, 0xe5, 0xc9, 0xe5, 0xcd, 0x87, 0xfb, 0xaf, 0xb7, 0x57, 0xac, 0xc3, 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0x0b, 0x3e, 0xd3,
|
||||||
0x75, 0x4a, 0x7c, 0xf9, 0x96, 0x90, 0x19, 0x51, 0xca, 0x59, 0xd2, 0x26, 0x98, 0x3d, 0x0b, 0xde,
|
0xeb, 0x94, 0xf8, 0xf2, 0x2d, 0x21, 0x33, 0xa2, 0x94, 0xb3, 0xa4, 0x4d, 0x30, 0x7b, 0x16, 0xbc,
|
||||||
0x05, 0x65, 0x2a, 0xfe, 0x11, 0xf0, 0xf3, 0x62, 0x49, 0x74, 0xdd, 0xcb, 0xba, 0xc8, 0x92, 0xdd,
|
0x0b, 0xca, 0x54, 0xfc, 0x23, 0xe0, 0xe7, 0xc5, 0x92, 0xe8, 0xba, 0x57, 0x75, 0x91, 0x25, 0xbb,
|
||||||
0x86, 0x16, 0x77, 0x2a, 0xc2, 0x93, 0x76, 0x54, 0x29, 0xdb, 0x10, 0x7b, 0x46, 0x5e, 0x74, 0x81,
|
0x0b, 0x2d, 0xee, 0x54, 0x84, 0x67, 0xed, 0xa8, 0x52, 0xb6, 0x21, 0xf6, 0x8c, 0xbc, 0xe8, 0x02,
|
||||||
0x7a, 0x6e, 0xae, 0x6f, 0xef, 0x38, 0x53, 0x59, 0x9e, 0x8a, 0x0b, 0x39, 0x66, 0x20, 0x67, 0x96,
|
0xf5, 0xdc, 0xde, 0xdc, 0xdd, 0x73, 0xa6, 0xb2, 0x3c, 0x15, 0x17, 0x72, 0xcc, 0x40, 0xce, 0x2c,
|
||||||
0x6a, 0x24, 0x08, 0x2b, 0x80, 0xa4, 0xdb, 0x0f, 0xe4, 0x4a, 0x3f, 0x3a, 0xb4, 0x83, 0x8a, 0x28,
|
0xd5, 0x48, 0x10, 0x56, 0x00, 0x49, 0xb7, 0x1f, 0xc8, 0x95, 0x7e, 0x74, 0x68, 0x07, 0x15, 0x51,
|
||||||
0x27, 0x82, 0x15, 0xc1, 0x14, 0xa7, 0xab, 0xd3, 0xd8, 0xf4, 0x96, 0xec, 0xbc, 0x9f, 0x6e, 0x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||||
0xb1, 0x20, 0xa7, 0x95, 0x65, 0x04, 0x07, 0x2a, 0x41, 0xe2, 0x0c, 0x55, 0x24, 0xbf, 0x2a, 0xfe,
|
0x58, 0x90, 0xd3, 0xca, 0x32, 0x82, 0x03, 0x95, 0x20, 0x71, 0x86, 0x2a, 0x92, 0x5f, 0x15, 0xff,
|
||||||
0xad, 0x71, 0xca, 0x6f, 0x48, 0x16, 0xdb, 0xaf, 0x59, 0x91, 0x4d, 0x38, 0xf2, 0xd0, 0x17, 0x91,
|
0xd6, 0x38, 0xe5, 0x37, 0x24, 0x8b, 0xed, 0xd7, 0xac, 0xc8, 0x26, 0x1c, 0x79, 0xe8, 0x8b, 0x48,
|
||||||
0x3a, 0x0b, 0xce, 0x24, 0x61, 0xc3, 0x81, 0xf6, 0x48, 0xf1, 0x27, 0xb5, 0x48, 0xdb, 0xf5, 0x59,
|
0x9d, 0x05, 0x67, 0x92, 0xb0, 0xe1, 0x40, 0x7b, 0xa4, 0xf8, 0x93, 0x5a, 0xa4, 0xed, 0xfa, 0x3c,
|
||||||
0x96, 0xbf, 0x6a, 0x69, 0xc2, 0x55, 0x7a, 0x18, 0x49, 0xda, 0x29, 0xa4, 0x52, 0xe5, 0x1d, 0x4a,
|
0xcb, 0x5f, 0xb5, 0x34, 0xe1, 0x2a, 0x3d, 0x8e, 0x24, 0xed, 0x14, 0x52, 0xa9, 0xf2, 0x0e, 0xa5,
|
||||||
0xeb, 0x87, 0x11, 0xd9, 0x2c, 0x57, 0x6b, 0x1d, 0x1c, 0x03, 0x7d, 0x14, 0x35, 0xc2, 0xc3, 0x68,
|
0xf5, 0xc3, 0x88, 0x6c, 0x96, 0xab, 0xb5, 0x0e, 0x8e, 0x81, 0x3e, 0x8a, 0x1a, 0xe1, 0x71, 0xb4,
|
||||||
0x23, 0x98, 0x19, 0xdd, 0x8c, 0x88, 0x94, 0xc9, 0x19, 0x3e, 0xcb, 0x48, 0x64, 0xb3, 0x53, 0xcf,
|
0x11, 0xcc,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, 0xc4, 0xf1, 0x03, 0x00, 0x00
|
0x49, 0x6c, 0xf3, 0x58, 0xf1, 0x03, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
4009
wled00/html_ui.h
4009
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user