From 6b40e5c251cfa60866fe861b81d134dabf7fb863 Mon Sep 17 00:00:00 2001 From: grch101 Date: Wed, 13 Jan 2021 19:21:16 +0100 Subject: [PATCH] Correcting some syntax problems in the html file. Now the website can be loaded from ROM --- html/index.html | 1137 ------------------------------------------ html/management.html | 32 +- src/HTMLmanagement.h | 32 +- src/main.cpp | 2 +- 4 files changed, 33 insertions(+), 1170 deletions(-) delete mode 100644 html/index.html diff --git a/html/index.html b/html/index.html deleted file mode 100644 index dd87e6a..0000000 --- a/html/index.html +++ /dev/null @@ -1,1137 +0,0 @@ - - - - ESPuino-Konfiguration - - - - - - - - - - - - - - - - - - -
- -
- - - - diff --git a/html/management.html b/html/management.html index 49fd34a..8f50b12 100644 --- a/html/management.html +++ b/html/management.html @@ -663,7 +663,7 @@ path: node.data.path + "/" + data.name, directory: data.dir } - } + }; return child; @@ -765,17 +765,17 @@ if (node.data.directory) { items.createDir = { - label: "Neuer Ordner", - action: function(x) { - var childNode = ref.create_node(nodeId, {text: "Neuer Ordner", type: "folder"}); - if(childNode) { - ref.edit(childNode, null, function(childNode, status){ - putData("/explorer?path=" + node.data.path + "/" + childNode.text); - refreshNode(nodeId); - }); + label: "Neuer Ordner", + action: function(x) { + var childNode = ref.create_node(nodeId, {text: "Neuer Ordner", type: "folder"}); + if(childNode) { + ref.edit(childNode, null, function(childNode, status){ + putData("/explorer?path=" + node.data.path + "/" + childNode.text); + refreshNode(nodeId); + }); + } } - } - } + }; } /* Play */ @@ -785,7 +785,7 @@ var playMode = node.data.directory?"5":"1"; postData("/exploreraudio?path=" + node.data.path + "&playmode=" + playMode); } - } + }; /* Refresh */ items.refresh = { @@ -793,7 +793,7 @@ action: function(x) { refreshNode(nodeId); } - } + }; /* Delete */ items.delete = { @@ -802,7 +802,7 @@ handleDeleteData(nodeId); refreshNode(ref.get_parent(nodeId)); } - } + }; /* Rename */ items.rename = { @@ -815,7 +815,7 @@ refreshNode(ref.get_parent(nodeId)); }); } - } + }; return items; } @@ -841,7 +841,7 @@ directory: data[i].dir }, children: [] - } + }; $('#explorerTree').jstree(true).settings.core.data.children.push(newChild); } diff --git a/src/HTMLmanagement.h b/src/HTMLmanagement.h index d2169e4..3126620 100644 --- a/src/HTMLmanagement.h +++ b/src/HTMLmanagement.h @@ -663,7 +663,7 @@ static const char management_HTML[] PROGMEM = "\ path: node.data.path + \"/\" + data.name,\ directory: data.dir\ }\ - }\ + };\ \ return child;\ \ @@ -765,17 +765,17 @@ static const char management_HTML[] PROGMEM = "\ \ if (node.data.directory) {\ items.createDir = {\ - label: \"Neuer Ordner\",\ - action: function(x) {\ - var childNode = ref.create_node(nodeId, {text: \"Neuer Ordner\", type: \"folder\"});\ - if(childNode) {\ - ref.edit(childNode, null, function(childNode, status){\ - putData(\"/explorer?path=\" + node.data.path + \"/\" + childNode.text);\ - refreshNode(nodeId);\ - });\ + label: \"Neuer Ordner\",\ + action: function(x) {\ + var childNode = ref.create_node(nodeId, {text: \"Neuer Ordner\", type: \"folder\"});\ + if(childNode) {\ + ref.edit(childNode, null, function(childNode, status){\ + putData(\"/explorer?path=\" + node.data.path + \"/\" + childNode.text);\ + refreshNode(nodeId);\ + });\ + }\ }\ - }\ - }\ + };\ }\ \ /* Play */\ @@ -785,7 +785,7 @@ static const char management_HTML[] PROGMEM = "\ var playMode = node.data.directory?\"5\":\"1\";\ postData(\"/exploreraudio?path=\" + node.data.path + \"&playmode=\" + playMode);\ }\ - }\ + };\ \ /* Refresh */\ items.refresh = {\ @@ -793,7 +793,7 @@ static const char management_HTML[] PROGMEM = "\ action: function(x) {\ refreshNode(nodeId);\ }\ - }\ + };\ \ /* Delete */\ items.delete = {\ @@ -802,7 +802,7 @@ static const char management_HTML[] PROGMEM = "\ handleDeleteData(nodeId);\ refreshNode(ref.get_parent(nodeId));\ }\ - }\ + };\ \ /* Rename */\ items.rename = {\ @@ -815,7 +815,7 @@ static const char management_HTML[] PROGMEM = "\ refreshNode(ref.get_parent(nodeId));\ });\ }\ - }\ + };\ \ return items;\ }\ @@ -841,7 +841,7 @@ static const char management_HTML[] PROGMEM = "\ directory: data[i].dir\ },\ children: []\ - }\ + };\ $('#explorerTree').jstree(true).settings.core.data.children.push(newChild);\ }\ \ diff --git a/src/main.cpp b/src/main.cpp index 8dbd824..6b817d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3596,7 +3596,7 @@ void webserverStart(void) { wServer.addHandler(&events); wServer.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { - request->send(FSystem, "/management.html", String(), false, templateProcessor); + request->send_P(200, "text/html", management_HTML, templateProcessor); }); wServer.on("/upload", HTTP_POST, [](AsyncWebServerRequest *request){