Skip to content

Commit f36073f

Browse files
committed
Add new 404 page
1 parent 595fd93 commit f36073f

File tree

7 files changed

+1684
-1662
lines changed

7 files changed

+1684
-1662
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- Return remaining nightlight time `nl.rem` in JSON API (PR #1302)
2626
- Added gamma calculation (yet unused)
2727
- Added LED type definitions to const.h (yet unused)
28+
- Added nicer 404 page
2829
- Removed `NP` and `MS=` macro HTTP API commands
2930
- Removed macros from Time settings
3031

tools/cdata.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ const char PAGE_dmxmap[] PROGMEM = R"=====()=====";
386386
method: "plaintext",
387387
filter: "html-minify",
388388
},
389+
{
390+
file: "404.htm",
391+
name: "PAGE_404",
392+
prepend: "=====(",
393+
append: ")=====",
394+
method: "plaintext",
395+
filter: "html-minify",
396+
},
389397
{
390398
file: "favicon.ico",
391399
name: "favicon",
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
color: white;
3636
border: 0px solid white;
3737
border-radius: 25px;
38-
filter: drop-shadow(0px 0px 1px #000);
3938
}
4039
</style>
4140
</head>

wled00/data/index.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@
323323

324324
#fxb0 {
325325
margin-bottom: 2px;
326+
filter: drop-shadow(0 0 1px #000);
326327
}
327328

328329
.first {

wled00/html_other.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ update();var tmout=null;function update(){if(document.hidden)return clearTimeout
7676
</script></body></html>)=====";
7777
7878
79+
// Autogenerated from wled00/data/404.htm, do not edit!!
80+
const char PAGE_404[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta charset="utf-8"><meta
81+
content="width=device-width" name="viewport"><meta name="theme-color"
82+
content="#222222"><title>Not found</title><style>
83+
body{font-family:Verdana,Helvetica,sans-serif;text-align:center;background-color:#222;margin:0;color:#fff}img{width:400px;max-width:50%;image-rendering:pixelated;image-rendering:crisp-edges;margin:25px 0 -10px 0}button{outline:0;cursor:pointer;padding:8px;margin:10px;width:230px;text-transform:uppercase;font-family:helvetica;font-size:19px;background-color:#333;color:#fff;border:0 solid #fff;border-radius:25px}
84+
</style></head><body><img alt=""
85+
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsEAAA7BAbiRa+0AAAFMSURBVFhH7ZTfbYNADMaPKDNUrJA85CEjdIjOgNQV+sASlZgmI/AIK6AuQfngnDrmjtpHItQ/P+l0juHsz2cH9+fJ/G7nreldfnDnp+ln/ZIlxbIfQmIwJOekCrEJ8FUvASEWEXoBiuSERcTO75uhuwFWff86bi57n3ZC+rW3YLqB5rn11ldCEPNr2LwFJgHHy8G1bTsu3oKYX4N5BrQ8ZAYewSoBGDjr0ElWCUC/rT2X7MqynL7tG4Dc45BwEYM9H5w7DqHMdfNCURR9nue3Iobk55MtOYeLoOQ8vmoG6o+0FaLrOm9FwC3wayLgx5I2WHpGIGYorulfgPYQ3AZLz4hQ9TMBVVVleJGrRUWz2YgQOg8bPjzzrit7vwcRQb5NTiARRPPzMYItoCpoWZITMkao+mRkddpqQ6z6FN+DfwFJrOm55GfewC/CuU/E4tQYg7BPYQAAAABJRU5ErkJggg==">
86+
<h1>404 Not Found</h1><b>Akemi does not know where you are headed...</b><br><br>
87+
<button onclick='window.location.href="/sliders"'>Back to controls</button>
88+
</body></html>)=====";
89+
90+
7991
// Autogenerated from wled00/data/favicon.ico, do not edit!!
8092
const uint16_t favicon_length = 954;
8193
const uint8_t favicon[] PROGMEM = {

wled00/html_ui.h

Lines changed: 1661 additions & 1660 deletions
Large diffs are not rendered by default.

wled00/wled_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void initServer()
217217
if(espalexa.handleAlexaApiCall(request)) return;
218218
#endif
219219
if(handleFileRead(request, request->url())) return;
220-
request->send(404, "text/plain", "Not Found");
220+
request->send_P(404, "text/html", PAGE_404);
221221
});
222222
}
223223

0 commit comments

Comments
 (0)