PixelForge adaptations for version 14.x
* different call for listing images * different call for deleting images * minor cleanups
This commit is contained in:
@@ -100,7 +100,7 @@ function adoptVersionAndRepo(html) {
|
|||||||
if (repoUrl) {
|
if (repoUrl) {
|
||||||
repoUrl = repoUrl.replace(/^git\+/, "");
|
repoUrl = repoUrl.replace(/^git\+/, "");
|
||||||
repoUrl = repoUrl.replace(/\.git$/, "");
|
repoUrl = repoUrl.replace(/\.git$/, "");
|
||||||
// html = strReplace(html, "https://github.com/wled-dev/WLED", repoUrl); // replacing upstream break "credits"
|
// html = html.replaceAll("https://github.com/wled-dev/WLED", repoUrl); // WLEDMM replacing upstream break "credits"
|
||||||
html = html.replaceAll("https://github.com/atuline/WLED", repoUrl);
|
html = html.replaceAll("https://github.com/atuline/WLED", repoUrl);
|
||||||
html = html.replaceAll("https://github.com/Aircoookie/WLED", repoUrl);
|
html = html.replaceAll("https://github.com/Aircoookie/WLED", repoUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ button, .btn {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- WLED-MM not yet supported -->
|
||||||
<div id="xTab" class="tabc">
|
<div id="xTab" class="tabc">
|
||||||
<h3 style="margin-top:20px;">Target Segment</h3>
|
<h3 style="margin-top:20px;">Target Segment</h3>
|
||||||
<select id="segT"></select>
|
<select id="segT"></select>
|
||||||
@@ -388,6 +389,8 @@ button, .btn {
|
|||||||
</div>
|
</div>
|
||||||
<div id="ti1D" style="display:none;">Not available in 1D</div>
|
<div id="ti1D" style="display:none;">Not available in 1D</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- WLEDMM end -->
|
||||||
|
|
||||||
<div id="oTab" class="tabc">
|
<div id="oTab" class="tabc">
|
||||||
<div class="ed active">
|
<div class="ed active">
|
||||||
<div>
|
<div>
|
||||||
@@ -444,7 +447,8 @@ let fL; // file list
|
|||||||
/* update file list */
|
/* update file list */
|
||||||
async function flU(){
|
async function flU(){
|
||||||
try{
|
try{
|
||||||
const r = await fetch(`${wu}/edit?func=list`);
|
//const r = await fetch(`${wu}/edit?func=list`);
|
||||||
|
const r = await fetch(`${wu}/edit?list=/`);
|
||||||
fL = await r.json();
|
fL = await r.json();
|
||||||
}catch(e){console.error(e);}
|
}catch(e){console.error(e);}
|
||||||
}
|
}
|
||||||
@@ -1097,7 +1101,10 @@ async function imgDel(){
|
|||||||
if(!confirm(`Delete ${sI.name}?`))return;
|
if(!confirm(`Delete ${sI.name}?`))return;
|
||||||
ovShow();
|
ovShow();
|
||||||
try{
|
try{
|
||||||
const r = await fetch(`${wu}/edit?func=delete&path=/${sI.name}`);
|
//const r = await fetch(`${wu}/edit?func=delete&path=/${sI.name}`);
|
||||||
|
const fd = new FormData();
|
||||||
|
fd.append('path', `/${sI.name}`);
|
||||||
|
const r = await fetch(`${wu}/edit`, {method:'DELETE', body: fd});
|
||||||
if(r.ok){ msg('Deleted'); imgRm(sI.name); }
|
if(r.ok){ msg('Deleted'); imgRm(sI.name); }
|
||||||
else msg('Delete failed! File in use?','err');
|
else msg('Delete failed! File in use?','err');
|
||||||
}catch(e){msg('Delete failed','err');}
|
}catch(e){msg('Delete failed','err');}
|
||||||
|
|||||||
@@ -479,8 +479,8 @@ void initServer()
|
|||||||
|
|
||||||
//called when the url is not defined here, ajax-in; get-settings
|
//called when the url is not defined here, ajax-in; get-settings
|
||||||
server.onNotFound([](AsyncWebServerRequest *request){
|
server.onNotFound([](AsyncWebServerRequest *request){
|
||||||
USER_PRINT("Not-Found HTTP call: ");
|
DEBUG_PRINT("Not-Found HTTP call: ");
|
||||||
USER_PRINTLN("URI: " + request->url());
|
DEBUG_PRINTLN("URI: " + request->url());
|
||||||
if (captivePortal(request)) return;
|
if (captivePortal(request)) return;
|
||||||
|
|
||||||
//make API CORS compatible
|
//make API CORS compatible
|
||||||
|
|||||||
Reference in New Issue
Block a user