Added file system info when generating the files list.

This commit is contained in:
Dirk Jahnke 2019-02-01 15:16:33 +01:00
parent 0f0ad4756f
commit d92b24e03a
1 changed files with 8 additions and 0 deletions

View File

@ -109,6 +109,14 @@ void WebServer::begin() {
json += "\"message\":\"" + message + "\""; json += "\"message\":\"" + message + "\"";
} else { } else {
json += "\"result\":\"OK\","; json += "\"result\":\"OK\",";
json += "\"fsinfo\":{";
json += "\"totalBytes\":" + String(fs_info.totalBytes) + ",";
json += "\"usedBytes\":" + String(fs_info.usedBytes) + ",";
json += "\"blockSize\":" + String(fs_info.blockSize) + ",";
json += "\"pageSize\":" + String(fs_info.pageSize) + ",";
json += "\"maxOpenFiles\":" + String(fs_info.maxOpenFiles) + ",";
json += "\"maxPathLength\":" + String(fs_info.maxPathLength) + ",";
json += "},";
json += "\"files\":\"["; json += "\"files\":\"[";
Dir dir = SPIFFS.openDir("/"); Dir dir = SPIFFS.openDir("/");
boolean isFirstEntry = true; boolean isFirstEntry = true;