Remove SPIFFS reference from ESP8266 react, use FS pointer instead

This commit is contained in:
Rick Watson 2020-05-25 11:30:13 +01:00
parent 98f49fd024
commit b4f3fbe823
3 changed files with 7 additions and 9 deletions

View File

@ -73,7 +73,7 @@ class SystemStatusForm extends Component<SystemStatusFormProps, SystemStatusForm
<MemoryIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary="Heap (Free / Max Alloc)" secondary={formatNumber(data.free_heap) + ' / ' + formatNumber(data.max_alloc_heap) + ' bytes (~' + this.approxHeapFragmentation() + '% fragmentation)'} />
<ListItemText primary="Heap (Free / Max Alloc)" secondary={formatNumber(data.free_heap) + ' / ' + formatNumber(data.max_alloc_heap) + ' bytes (~' + this.approxHeapFragmentation() + '%\xa0fragmentation)'} />
</ListItem>
<Divider variant="inset" component="li" />
<ListItem >
@ -100,7 +100,7 @@ class SystemStatusForm extends Component<SystemStatusFormProps, SystemStatusForm
<FolderIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary="File System (Used / Total)" secondary={formatNumber(data.fs_used) + ' / ' + formatNumber(data.fs_total) + ' bytes (' + formatNumber(data.fs_total - data.fs_used) + ' bytes free)'} />
<ListItemText primary="File System (Used / Total)" secondary={formatNumber(data.fs_used) + ' / ' + formatNumber(data.fs_total) + ' bytes (' + formatNumber(data.fs_total - data.fs_used) + '\xa0bytes free)'} />
</ListItem>
<Divider variant="inset" component="li" />
</Fragment>

View File

@ -42,11 +42,11 @@ ESP8266React::ESP8266React(AsyncWebServer* server, FS* fs) :
});
#else
// Serve static resources from /www/
server->serveStatic("/js/", SPIFFS, "/www/js/");
server->serveStatic("/css/", SPIFFS, "/www/css/");
server->serveStatic("/fonts/", SPIFFS, "/www/fonts/");
server->serveStatic("/app/", SPIFFS, "/www/app/");
server->serveStatic("/favicon.ico", SPIFFS, "/www/favicon.ico");
server->serveStatic("/js/", *fs, "/www/js/");
server->serveStatic("/css/", *fs, "/www/css/");
server->serveStatic("/fonts/", *fs, "/www/fonts/");
server->serveStatic("/app/", *fs, "/www/app/");
server->serveStatic("/favicon.ico", *fs, "/www/favicon.ico");
// Serving all other get requests with "/www/index.htm"
// OPTIONS get a straight up 200 response
server->onNotFound([](AsyncWebServerRequest* request) {

View File

@ -5,12 +5,10 @@
#ifdef ESP32
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <WiFi.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <FS.h>
#endif
#include <APSettingsService.h>