From d92b24e03a30337664c248c205b651acce80dc25 Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Fri, 1 Feb 2019 15:16:33 +0100 Subject: [PATCH] Added file system info when generating the files list. --- src/WebServer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/WebServer.cpp b/src/WebServer.cpp index e65c16c..66432b7 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -109,6 +109,14 @@ void WebServer::begin() { json += "\"message\":\"" + message + "\""; } else { 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\":\"["; Dir dir = SPIFFS.openDir("/"); boolean isFirstEntry = true;