Включаем поддержку esp32 для редактора ручных натсроек

This commit is contained in:
2022-05-19 09:48:28 +03:00
parent 29a2762788
commit 67148de250

View File

@@ -204,14 +204,12 @@ void handleFileList() {
HTTP.send(500, "text/plain", "BAD ARGS"); HTTP.send(500, "text/plain", "BAD ARGS");
return; return;
} }
String path = HTTP.arg("list"); File dir = FileFS.open(HTTP.arg("list"), "r");
Dir dir = FileFS.openDir(path);
path = String();
String output = "["; String output = "[";
while (dir.next()) { File entry;
File entry = dir.openFile("r"); while (entry = dir.openNextFile()) {
if (output != "[") output += ','; if (output != "[") output += ',';
bool isDir = dir.isDirectory(); bool isDir = entry.isDirectory();
output += "{\"type\":\""; output += "{\"type\":\"";
output += (isDir) ? "dir" : "file"; output += (isDir) ? "dir" : "file";
output += "\",\"name\":\""; output += "\",\"name\":\"";