From c4d8ef59544d01cf4fb15cfd3beafaef17e3ec71 Mon Sep 17 00:00:00 2001 From: Sander Schutten Date: Sat, 19 Dec 2020 17:26:36 +0000 Subject: [PATCH] Added liveviewws-page for liveview via websockets --- tools/cdata.js | 8 + wled00/data/liveviewws.htm | 62 + wled00/html_other.h | 11 + wled00/html_ui.h | 2832 ++++++++++++++++++------------------ wled00/wled_server.cpp | 12 +- 5 files changed, 1503 insertions(+), 1422 deletions(-) create mode 100644 wled00/data/liveviewws.htm diff --git a/tools/cdata.js b/tools/cdata.js index aa473deb1..dd2bc7f24 100644 --- a/tools/cdata.js +++ b/tools/cdata.js @@ -386,6 +386,14 @@ const char PAGE_dmxmap[] PROGMEM = R"=====()====="; method: "plaintext", filter: "html-minify", }, + { + file: "liveviewws.htm", + name: "PAGE_liveviewws", + prepend: "=====(", + append: ")=====", + method: "plaintext", + filter: "html-minify", + }, { file: "404.htm", name: "PAGE_404", diff --git a/wled00/data/liveviewws.htm b/wled00/data/liveviewws.htm new file mode 100644 index 000000000..bc1e82936 --- /dev/null +++ b/wled00/data/liveviewws.htm @@ -0,0 +1,62 @@ + + + + + + + WLED Live Preview + + + +
+ + + \ No newline at end of file diff --git a/wled00/html_other.h b/wled00/html_other.h index 1e51b2137..c363f6b32 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -76,6 +76,17 @@ update();var tmout=null;function update(){if(document.hidden)return clearTimeout )====="; +// Autogenerated from wled00/data/liveviewws.htm, do not edit!! +const char PAGE_liveviewws[] PROGMEM = R"=====( +WLED Live Preview
)====="; + + // Autogenerated from wled00/data/404.htm, do not edit!! const char PAGE_404[] PROGMEM = R"=====(send_P(200, "text/html", PAGE_liveview); - }); + #ifdef WLED_ENABLE_WEBSOCKETS + server.on("/liveview", HTTP_GET, [](AsyncWebServerRequest *request){ + request->send_P(200, "text/html", PAGE_liveviewws); + }); + #else + server.on("/liveview", HTTP_GET, [](AsyncWebServerRequest *request){ + request->send_P(200, "text/html", PAGE_liveview); + }); + #endif //settings page server.on("/settings", HTTP_GET, [](AsyncWebServerRequest *request){