use "fs" instead of "spiffs" as spiffs is implementation specific

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

View File

@ -7,7 +7,7 @@ import DevicesIcon from '@material-ui/icons/Devices';
import MemoryIcon from '@material-ui/icons/Memory'; import MemoryIcon from '@material-ui/icons/Memory';
import ShowChartIcon from '@material-ui/icons/ShowChart'; import ShowChartIcon from '@material-ui/icons/ShowChart';
import SdStorageIcon from '@material-ui/icons/SdStorage'; import SdStorageIcon from '@material-ui/icons/SdStorage';
import StorageIcon from '@material-ui/icons/Storage'; import FolderIcon from '@material-ui/icons/Folder';
import DataUsageIcon from '@material-ui/icons/DataUsage'; import DataUsageIcon from '@material-ui/icons/DataUsage';
import PowerSettingsNewIcon from '@material-ui/icons/PowerSettingsNew'; import PowerSettingsNewIcon from '@material-ui/icons/PowerSettingsNew';
import RefreshIcon from '@material-ui/icons/Refresh'; import RefreshIcon from '@material-ui/icons/Refresh';
@ -97,10 +97,10 @@ class SystemStatusForm extends Component<SystemStatusFormProps, SystemStatusForm
<ListItem > <ListItem >
<ListItemAvatar> <ListItemAvatar>
<Avatar> <Avatar>
<StorageIcon /> <FolderIcon />
</Avatar> </Avatar>
</ListItemAvatar> </ListItemAvatar>
<ListItemText primary="SPIFFS (Used / Total)" secondary={formatNumber(data.spiffs_used) + ' / ' + formatNumber(data.spiffs_total) + ' bytes (' + formatNumber(data.spiffs_total - data.spiffs_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) + ' bytes free)'} />
</ListItem> </ListItem>
<Divider variant="inset" component="li" /> <Divider variant="inset" component="li" />
</Fragment> </Fragment>

View File

@ -8,8 +8,8 @@ export interface SystemStatus {
sdk_version: string; sdk_version: string;
flash_chip_size: number; flash_chip_size: number;
flash_chip_speed: number; flash_chip_speed: number;
spiffs_used: number; fs_used: number;
spiffs_total: number; fs_total: number;
} }
export interface OTASettings { export interface OTASettings {

View File

@ -26,13 +26,13 @@ void SystemStatus::systemStatus(AsyncWebServerRequest* request) {
root["flash_chip_speed"] = ESP.getFlashChipSpeed(); root["flash_chip_speed"] = ESP.getFlashChipSpeed();
#ifdef ESP32 #ifdef ESP32
root["spiffs_total"] = SPIFFS.totalBytes(); root["fs_total"] = SPIFFS.totalBytes();
root["spiffs_used"] = SPIFFS.usedBytes(); root["fs_used"] = SPIFFS.usedBytes();
#elif defined(ESP8266) #elif defined(ESP8266)
FSInfo fs_info; FSInfo fs_info;
SPIFFS.info(fs_info); SPIFFS.info(fs_info);
root["spiffs_total"] = fs_info.totalBytes; root["fs_total"] = fs_info.totalBytes;
root["spiffs_used"] = fs_info.usedBytes; root["fs_used"] = fs_info.usedBytes;
#endif #endif
response->setLength(); response->setLength();