Display total space, used space and % occuped

in file manager for SPIFFS
This commit is contained in:
luc
2015-10-23 11:58:07 +08:00
parent 94232ca720
commit eae00a3648
2 changed files with 15 additions and 2 deletions

View File

@@ -2394,7 +2394,15 @@ void handleFileList() {
f.close();
}
jsonfile+="],";
jsonfile+="\"status\":\"" + status + "\"";
jsonfile+="\"status\":\"" + status + "\",";
uint32_t total;
uint32_t used;
SPIFFS.info(&total,&used);
jsonfile+="\"total\":\"" + formatBytes(total) + "\",";
jsonfile+="\"used\":\"" + formatBytes(used) + "\",";
jsonfile+="\"occupation\":\"" ;
jsonfile+= intTostr(100*used/total);
jsonfile+="%\"";
jsonfile+="}";
path = "";
web_interface->WebServer.send(200, "application/json", jsonfile);