-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Revamp of the FSBrowser and SDWebServer examples #7182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 136 commits
Commits
Show all changes
138 commits
Select commit
Hold shift + click to select a range
3d65027
Minimal file with a few ESP8266-specific keywords - github issue #3701
vdeconinck 8370794
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck 211929c
Renamed "SDWebServer" to the more universal "WebFileManager"
vdeconinck a1ed3ba
SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
vdeconinck 3c42a8d
Tree panel width is now proportional to window. Changed icons (lighte…
vdeconinck 82d50b4
Replaced by a lighter version
vdeconinck 4e04514
Return the filesystem time in the status object
vdeconinck 6aad505
Fixed folder handling
vdeconinck 26b772d
Replaced the FILESYSTEM #define by a filesystem variable, and introdu…
vdeconinck c1947d4
Made 8.3 lowercase filenames formating optional (disabled by default).
vdeconinck 83e3c49
Added 'wait' cursor during asynchronous operations.
vdeconinck 5217201
Removed limitation "files must have an extension, folders may not".
vdeconinck 40310da
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck df49379
Support Filenames without extension, Dirnames with extension.
vdeconinck 637cb4d
Fixed tree refresh on delete in all cases by returning the remaining …
vdeconinck 36e28cc
Changed FS status in text by a percentage graph, with numbers as tool…
vdeconinck 99cf471
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck f76dfaf
Small fix + refactoring
vdeconinck f0b87ef
Restrict filename support check to SPIFFS.
vdeconinck 53126c5
Implemented Move/Rename.
vdeconinck ad3b008
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck 967d037
Fixed broken spinner
vdeconinck e3529e9
Cosmetic improvements.
vdeconinck 3745906
Added specific icons for text and image files.
vdeconinck 2aabb70
Added favicon.ico.
vdeconinck 83644bb
Renaming project
vdeconinck 73490be
Renamed project
vdeconinck 11635c5
Renamed project
vdeconinck 6354c9f
Small changes
vdeconinck b32f6c7
Add a note about the ace.js dependency
vdeconinck 94c5ad7
Minor changes
vdeconinck 99ba015
Define LittleFS by default.
vdeconinck 6f48db4
Define LittleFS by default.
vdeconinck 30eeeb6
Restyled version
vdeconinck f40f212
Merge branch 'master' into master
d-a-v 3889b96
(dummy edit to retrigger broken CI)
vdeconinck 24cd70f
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck 441ae32
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck cc61220
Using unsigned int for comparison with String.length()
vdeconinck 6fcbdf2
Return an error when upload fails (e.g. filesystem full)
vdeconinck ab34ffc
Merge branch 'master' into master
earlephilhower 534081a
Trying to reorder functions to please CI
vdeconinck 440251e
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck b6ba07e
Reordered functions to please CI.
vdeconinck 9a81b8b
Moved file
vdeconinck bb8f250
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck c953d96
Renamed "SDWebServer" to the more universal "WebFileManager"
vdeconinck 6ca8da5
SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
vdeconinck 6d501ab
Tree panel width is now proportional to window. Changed icons (lighte…
vdeconinck 4ae345f
Replaced by a lighter version
vdeconinck 4fab7e7
Return the filesystem time in the status object
vdeconinck 82904ff
Fixed folder handling
vdeconinck b68f5fd
Replaced the FILESYSTEM #define by a filesystem variable, and introdu…
vdeconinck 842b914
Made 8.3 lowercase filenames formating optional (disabled by default).
vdeconinck 5c0d0a7
Added 'wait' cursor during asynchronous operations.
vdeconinck 2864f35
Removed limitation "files must have an extension, folders may not".
vdeconinck 992fa31
Support Filenames without extension, Dirnames with extension.
vdeconinck da09f36
Fixed tree refresh on delete in all cases by returning the remaining …
vdeconinck f0587c2
Changed FS status in text by a percentage graph, with numbers as tool…
vdeconinck c6948fc
Small fix + refactoring
vdeconinck 16acb24
Restrict filename support check to SPIFFS.
vdeconinck 9bba9dd
Implemented Move/Rename.
vdeconinck 1fec42a
Fixed broken spinner
vdeconinck 7cc0eb2
Cosmetic improvements.
vdeconinck d709ae5
Added specific icons for text and image files.
vdeconinck 0b3ba4e
Added favicon.ico.
vdeconinck f541b6d
Renaming project
vdeconinck 917dacd
Renamed project
vdeconinck 86dfa58
Renamed project
vdeconinck 86b54a4
Small changes
vdeconinck 1c5d10f
Add a note about the ace.js dependency
vdeconinck 170f3fb
Minor changes
vdeconinck ef26c49
Define LittleFS by default.
vdeconinck 780db41
Define LittleFS by default.
vdeconinck 697f133
Restyled version
vdeconinck 612b8ca
(dummy edit to retrigger broken CI)
vdeconinck 180705a
Using unsigned int for comparison with String.length()
vdeconinck c4b7369
Return an error when upload fails (e.g. filesystem full)
vdeconinck b993004
Trying to reorder functions to please CI
vdeconinck 109ca0c
Reordered functions to please CI.
vdeconinck bc580c7
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck d6a8350
Update to use chunked response API
vdeconinck c3a33e6
Removed temp files commited by mistake
vdeconinck 16b9329
Avoid using args() as requested
vdeconinck b0fa096
Use html entity for non-breaking space to avoid losing char when mini…
vdeconinck 50f2a73
Script to preprocess index.htm
vdeconinck ecfa7ba
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck 88968df
(reformated code)
vdeconinck 1e04240
(comments)
vdeconinck dd3fe6d
Preprocessed files
vdeconinck 54f8d79
Fixed dump to create an actual include file
vdeconinck 5728526
Optionally embed index.htm in code.
vdeconinck 0052336
(reformated)
vdeconinck 616297f
Merge branch 'master' into master
vdeconinck fccbfff
Merge branch 'master' into master
vdeconinck d7e6d27
If editor cannot be loaded from the web, try a local version, or default
vdeconinck ac1ff02
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck d2fe22e
(removed a TODO item :-))
vdeconinck 25d2600
Merge branch 'master' into master
earlephilhower 461a7f1
(forgot to reprocess files after last commit)
vdeconinck 30fe3ab
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck cb98a52
(reprocess should be ok this time)
vdeconinck bc09207
Return error 500 when upload fails immediately (e.g. filesystem full)
vdeconinck 941a7ec
Use standard <meter> tag for filesystem use
vdeconinck 3fc2416
(updated following changes to index.htm)
vdeconinck 3bdd5f0
Merge branch 'master' into master
d-a-v c5b66ff
Merge branch 'master' into master
vdeconinck c5f99a3
Merge branch 'master' into master
devyte 6b66a8f
Merge branch 'master' of https://github.com/esp8266/Arduino
vdeconinck 102908f
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck c35b72e
Do not include gzipped version in the data folder by default. Leave i…
vdeconinck 1b4499b
Gzipped index file not included in data/edit by default. It is now le…
vdeconinck 52e5809
Reduce String clutter by reserving and concatenating elements one by …
vdeconinck cb8938f
Use clear() to reset String.
vdeconinck 83fcdc9
Avoid comparisons against empty String.
vdeconinck fcfca4c
Use char instead of single-char String where possible.
vdeconinck 1115837
Prefer direct logic over inverted.
vdeconinck 14463dc
Rename returnBlah to replyBlah.
vdeconinck cffeb76
Renamed h2int to hexDigitToInt
vdeconinck c8a2181
Renamed getFileError() to checkForUnsupportedPath(), to avoid confusion
vdeconinck a740ec2
Misc improvements.
vdeconinck d6eb21d
Added comments about mandatory rebuilding gz and h files in case of u…
vdeconinck cb7b0d1
Addressed a few comments.
vdeconinck c4b4ec0
Improve replies: bad requests vs server error
vdeconinck 6f6ed1d
(reformated)
vdeconinck 998de01
Reduce clutter by reserving String size beforehand.
vdeconinck b8b7d85
Moved most Strings of more than 10 chars to flash.
vdeconinck d5af55b
Merge branch 'master' into master
vdeconinck 2aabe70
Use lib version of urlDecode() instead of a local one, and only call …
vdeconinck 5c86ac0
Added a comment about the dangers of recursion on embedded devices.
vdeconinck 50ea735
Added a more explicit warning in the .h header comment.
vdeconinck e53c634
Added a typical set of required files to load ace editor from the ESP.
vdeconinck 065b366
Merge branch 'master' of https://github.com/vdeconinck/Arduino-1
vdeconinck cc32ac8
(reformated)
vdeconinck d6db83d
More explicit warning at the beginning of the .h version.
vdeconinck 2384e90
Merge branch 'master' into master
vdeconinck 2a48168
Merge branch 'master' into master
devyte 0348a17
Merge branch 'master' into master
devyte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
735 changes: 551 additions & 184 deletions
735
libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1,128 changes: 1,128 additions & 0 deletions
1,128
libraries/ESP8266WebServer/examples/FSBrowser/data/edit/index.htm
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
99 changes: 12 additions & 87 deletions
99
libraries/ESP8266WebServer/examples/FSBrowser/data/index.htm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,22 @@ | ||
<!-- | ||
FSWebServer - Example Index Page | ||
Copyright (c) 2015 Hristo Gochkov. All rights reserved. | ||
This file is part of the ESP8266WebServer library for Arduino environment. | ||
|
||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | ||
<title>ESP Monitor</title> | ||
<script type="text/javascript" src="graphs.js"></script> | ||
<script type="text/javascript"> | ||
var heap,temp,digi; | ||
var reloadPeriod = 1000; | ||
var running = false; | ||
|
||
function loadValues(){ | ||
if(!running) return; | ||
var xh = new XMLHttpRequest(); | ||
xh.onreadystatechange = function(){ | ||
if (xh.readyState == 4){ | ||
if(xh.status == 200) { | ||
var res = JSON.parse(xh.responseText); | ||
heap.add(res.heap); | ||
temp.add(res.analog); | ||
digi.add(res.gpio); | ||
if(running) setTimeout(loadValues, reloadPeriod); | ||
} else running = false; | ||
} | ||
}; | ||
xh.open("GET", "/all", true); | ||
xh.send(null); | ||
}; | ||
|
||
function run(){ | ||
if(!running){ | ||
running = true; | ||
loadValues(); | ||
} | ||
<title>ESP Index</title> | ||
<style> | ||
body { | ||
background-color:black; | ||
color:white; | ||
} | ||
|
||
</style> | ||
<script type="text/javascript"> | ||
function onBodyLoad(){ | ||
var refreshInput = document.getElementById("refresh-rate"); | ||
refreshInput.value = reloadPeriod; | ||
refreshInput.onchange = function(e){ | ||
var value = parseInt(e.target.value); | ||
reloadPeriod = (value > 0)?value:0; | ||
e.target.value = reloadPeriod; | ||
} | ||
var stopButton = document.getElementById("stop-button"); | ||
stopButton.onclick = function(e){ | ||
running = false; | ||
} | ||
var startButton = document.getElementById("start-button"); | ||
startButton.onclick = function(e){ | ||
run(); | ||
} | ||
|
||
// Example with 10K thermistor | ||
//function calcThermistor(v) { | ||
// var t = Math.log(((10230000 / v) - 10000)); | ||
// t = (1/(0.001129148+(0.000234125*t)+(0.0000000876741*t*t*t)))-273.15; | ||
// return (t>120)?0:Math.round(t*10)/10; | ||
//} | ||
//temp = createGraph(document.getElementById("analog"), "Temperature", 100, 128, 10, 40, false, "cyan", calcThermistor); | ||
|
||
temp = createGraph(document.getElementById("analog"), "Analog Input", 100, 128, 0, 1023, false, "cyan"); | ||
heap = createGraph(document.getElementById("heap"), "Current Heap", 100, 125, 0, 30000, true, "orange"); | ||
digi = createDigiGraph(document.getElementById("digital"), "GPIO", 100, 146, [0, 4, 5, 16], "gold"); | ||
run(); | ||
console.log("we are loaded!!"); | ||
} | ||
</script> | ||
</head> | ||
<body id="index" style="margin:0; padding:0;" onload="onBodyLoad()"> | ||
<div id="controls" style="display: block; border: 1px solid rgb(68, 68, 68); padding: 5px; margin: 5px; width: 362px; background-color: rgb(238, 238, 238);"> | ||
<label>Period (ms):</label> | ||
<input type="number" id="refresh-rate"/> | ||
<input type="button" id="start-button" value="Start"/> | ||
<input type="button" id="stop-button" value="Stop"/> | ||
</div> | ||
<div id="heap"></div> | ||
<div id="analog"></div> | ||
<div id="digital"></div> | ||
<body id="index" onload="onBodyLoad()"> | ||
<h1>ESP8266 Pin Functions</h1> | ||
<img src="pins.png" /> | ||
</body> | ||
</html> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.52 KB
libraries/ESP8266WebServer/examples/FSBrowser/extras/feathericons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
529 changes: 529 additions & 0 deletions
529
libraries/ESP8266WebServer/examples/FSBrowser/extras/index_htm.h
Large diffs are not rendered by default.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
libraries/ESP8266WebServer/examples/FSBrowser/extras/reduce_index.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#/bin/sh | ||
|
||
# Processing script to optionally reduce filesystem use by miniying, gzipping and preparing index.htm for embedding in code. | ||
# Please see readme.md for more information. | ||
|
||
# Requires xdd which is part of the VIM package | ||
# Requires npm | ||
# sudo apt install npm | ||
# ln -s /usr/bin/nodejs /usr/bin/node | ||
# Requires html-minifier | ||
# sudo npm install html-minifier -g | ||
|
||
html-minifier \ | ||
--case-sensitive \ | ||
--collapse-boolean-attributes \ | ||
--collapse-whitespace \ | ||
--minify-css true \ | ||
--minify-js true \ | ||
--process-conditional-comments \ | ||
--remove-attribute-quotes \ | ||
--remove-comments \ | ||
--remove-empty-attributes \ | ||
--remove-optional-tags \ | ||
--remove-redundant-attributes \ | ||
--remove-script-type-attributes \ | ||
--remove-style-link-type-attributes \ | ||
-o index.htm \ | ||
../data/edit/index.htm | ||
|
||
if [ $? -ne 0 ] | ||
then | ||
echo "Error minifying index.htm" | ||
exit -1 | ||
fi | ||
|
||
if [ -e index.htm.gz ] | ||
then | ||
rm index.htm.gz | ||
fi | ||
|
||
gzip index.htm | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Error gzipping minified index.htm" | ||
exit -1 | ||
fi | ||
|
||
echo '// WARNING: Auto-generated file. Please do not modify by hand.' > index_htm.h | ||
echo '// This file is an embeddable version of the gzipped index.htm file.' >> index_htm.h | ||
echo '// To update it, please rerun the `reduce_index.sh` script located in the `extras` subfolder' >> index_htm.h | ||
echo '// then recompile the sketch after each change to the `index.html` file.' >> index_htm.h | ||
xxd -i index.htm.gz >> index_htm.h | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Error creating include file from index.htm.gz" | ||
exit -1 | ||
fi | ||
|
||
echo Reduce complete. | ||
|
138 changes: 138 additions & 0 deletions
138
libraries/ESP8266WebServer/examples/FSBrowser/readme.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# FSBrowser readme | ||
|
||
## What is this sketch about ? | ||
|
||
This example is a FileSystem Browser for the ESP8266 using http requests and a html/javascript frontend, | ||
working for all of SPIFFS, LittleFS and SDFS. | ||
This unified version is based on the previous examples named FSWebServer, FSBrowser and SDWebServer, Copyright (c) 2015 Hristo Gochkov. All rights reserved. | ||
|
||
## How to use it ? | ||
1. Uncomment one of the `#define USE_xxx` directives in the sketch | ||
2. Add the credentials of your WiFi network (search for `STASSID`) | ||
3. Compile and upload the sketch to your ESP8266 device | ||
4. For normal use, copy the contents of the `data` folder to the filesystem. To do so: | ||
- for SDFS, copy that contents (not the data folder itself, just its contents) to the root of a FAT/FAT32-formated SD card connected to the SPI port of the ESP8266 | ||
- for SPIFFS or LittleFS, please follow the instructions at https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system | ||
5. Once the data and sketch have been uploaded, access the editor by pointing your browser to http://fsbrowser.local/edit | ||
vdeconinck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Options | ||
If you need to free some space on the ESP filesystem, you can delete all the sample files at the root but also replace the `index.htm` file in the `data/edit` subfolder by the `index.htm.gz` file from the `extras` folder. That compressed version is not suited for learning or debugging, but will bring the total FS usage under 7KB. | ||
vdeconinck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
If you want to use the browser on a an existing filesystem or don't want to perform step 4 above, you have two possibilities : | ||
- either upload the `index.htm` file to the filesystem by opening a command shell in the `data` folder and running the following cURL command: | ||
`curl -F file=@edit/index.htm;filename=/edit/index.htm fsbrowser.local/edit` | ||
- or embed a version of the html page in the source code itself by uncommenting the following line in the sketch and rebuilding: | ||
`#define INCLUDE_FALLBACK_INDEX_HTM` | ||
That embedded version is functionally equivalent and will be returned if no `/edit/index.htm` or `/edit/index.htm.gz` file can be found on the filesystem, at the expense of a higher binary size. | ||
|
||
If you use the gzipped or `INCLUDE_FALLBACK_INDEX_HTM` options, please remember to rerun the `reduce_index.sh` script located in the `extras` subfolder and recompile the sketch after each change to the `index.html` file. | ||
|
||
## Dependency | ||
The html page uses the [Ace.js](https://ace.c9.io/) (v1.4.9 at the time of writing) text editor which is loaded from a CDN. Consequently, internet access from your web browser is required for the FSBrowser editing feature to work as-is. | ||
|
||
If your browser has no web access (e.g. if you are connected to the ESP8266 as an access-point), you can copy the `ace.js` file to the `edit` subfolder of the ESP filesystem, along with optional plugins etc. according to your needs. A typical set might be: | ||
``` | ||
ace.js | ||
ext-keybinding_menu.js | ||
ext-searchbox.js | ||
mode-html.js | ||
worker-html.js | ||
worker-css.js | ||
worker-javascript.js | ||
mode-xml.js | ||
worker-xml.js | ||
mode-json.js | ||
worker-json.js | ||
``` | ||
(see https://github.com/ajaxorg/ace-builds for a full list). | ||
|
||
If `ace.js` cannot be found on the ESP filesystem either, the page will default to a plain text viewer, with a warning message. | ||
|
||
## Notes | ||
- See https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html for more information on FileSystems supported by the ESP8266. | ||
- For SDFS, if your card's CS pin is not connected to the default pin (4), uncomment the `fileSystemConfig.setCSPin(chipSelectPin);` line, specifying the GPIO the CS pin is connected to | ||
- `index.htm` is the default index returned if your URL does not end with a filename (works on subfolders as well) | ||
- Filesystem limitations apply. For example, FAT16 is limited to 8.3 filenames - see https://en.wikipedia.org/wiki/8.3_filename - SPIFFS and LittleFS also have limitations, please see https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#spiffs-file-system-limitations | ||
- Directories are supported on SDFS and LittleFS. On SPIFFS, all files are at the root, although their names may contain the "/" character. | ||
- The convention here is that the root of the filesystem is "/". On SPIFFS, paths not started with a slash are not supported | ||
- For creation, the convention is that a path ending with a "/" means create a folder, while without a "/" we create a file. Having an extension or not does not matter. | ||
|
||
## Changelog since original FSBrowser | ||
|
||
### Fixes to work on LittleFS based on SDFS | ||
- #define logic to select FS | ||
- switched from SD to SDFS | ||
- begin() does not support parameters > removed SS and added optional config | ||
- LittleFS.open() second parametsr is mandatory > specified "r" where needed | ||
- 'FILE_WRITE' was not declared in this scope > replaced by "w" | ||
|
||
### UI/usability improvements | ||
- Never format filesystem, just return "FS INIT ERROR" when FS cannot be mounted | ||
- Tree panel width is now proportional (20%) to see long names on big screens | ||
- Added icons for files, and indented them to the same level as folders | ||
- Changed file/folder icon set to use a lighter and more neutral one, and added specific "text" and "image" icons for formats recognized as such | ||
- Items are now sorted (folders first, then plain files, each in alphabetic order) | ||
- Added file size after each file name | ||
- Added FS status information at the top right | ||
- Made clear that an async operation is in progress by dimming screen and showing operation status | ||
- Filled filename box in header with the name of the last clicked file | ||
- Selecting a file for upload defaults to putting it in the same folder as the last clicked file | ||
- Removed limitation to 8.3 lowercase filenames | ||
- Support Filenames without extension, Dirnames with extension | ||
- Improved recursive refresh of parts of the tree (e.g. refresh folder upon file delete, show last folder upon creating nested file) | ||
- Added Save/Discard/Help buttons to ACE editor, discard confirmation on leave, and refresh tree and status upon save | ||
- Removed "Upload" from context menu (which didn't work anyway) | ||
- Added "Rename/Move" feature to context menu | ||
- Sketch can be used on a preexisting filesystem by embedding the index.htm file in the program | ||
|
||
## TODO (maybe) | ||
- ? How can we query the fatType of the SDFS (FAT16 or FAT32) to limit filenames to 8.3 on FAT16 ? | ||
- ? Add a visible root node "/" (with no delete option) + add the FS type next to it, like <i>LittleFS</i> | ||
- ? move "Mkdir" and "MkFile" to context menu, with prompt like for Rename/Move | ||
- ? implement drag/drop for move + make "rename" only a local rename operation (no move) | ||
- ? Optionally present SPIFFS as a hierarchical FS too | ||
- ? Optionally mount several filesystems at the same time (SPIFFS + SDFS or LittleFS + SDFS) | ||
|
||
## Test suite | ||
These tests are a checklist of operations to verify the FSBrowser behaviour. | ||
### On SPIFFS | ||
#### 8.3 filenames | ||
- At root : MkFile '/1.txt' / List / Edit / Download / Delete / Upload '/1.png' / View image / Delete image | ||
- In subdir : MkFile '/dir/2.txt' / List / Edit / Download / Delete / Upload '/dir/2.png' / View image | ||
- Create nested file '/a/b.txt' and delete it | ||
- Attempt creation of unsupported filenames | ||
#### Long filenames | ||
- At root : MkFile '/My text file 1.txt' / List / Edit / Download / Delete / Upload '/My image file 1.png' / View image / Delete image | ||
- In subdir : MkFile '/My Directory/My text 2.txt' / List / Edit / Download / Delete / Upload '/My Directory/My image 2.png' / View image | ||
- Create nested file '/My folder/My test file.txt' and delete it | ||
|
||
### On LittleFS | ||
#### 8.3 filenames | ||
- At root : MkFile '/1.txt' / List / Edit / Download / Delete / Upload '/1.png' / View image / Delete image / Mkdir '/dir' | ||
- In subdir : MkFile '/dir/2.txt' / List / Edit / Download / Delete / Upload '/dir/2.png' / View image / Mkdir '/dir/sub' | ||
- Delete root folder '/dir' | ||
- Create nested file '/a/b.txt' and delete file 'b.txt' | ||
#### Long filenames | ||
- At root : MkFile '/My text file 1.txt' / List / Edit / Download / Delete / Upload '/My image file 1.png' / View image / Delete image / Mkdir '/My Directory' | ||
- In subdir : MkFile '/My Directory/My text file 2.txt' / List / Edit / Download / Delete / Upload '/My Directory/My image file 2.png' / View image / Mkdir '/My Directory/My Subdirectory' | ||
- Delete root folder '/My Directory' | ||
- Create nested file '/My folder/My test file.txt' and delete file 'My test file.txt' | ||
|
||
### On SDFS | ||
#### 8.3 filenames | ||
- At root : MkFile '/1.txt' / List / Edit / Download / Delete / Upload '/1.png' / View image / Delete image / Mkdir '/dir' | ||
- In subdir : MkFile '/dir/2.txt' / List / Edit / Download / Delete / Upload '/dir/2.png' / View image / Mkdir '/dir/sub' | ||
- Delete root folder '/dir' | ||
- Create nested file '/a/b.txt' and delete file 'b.txt', then delete '/a' | ||
#### Long filenames | ||
- At root : MkFile '/My text file 1.txt' / List / Edit / Download / Delete / Upload '/My image file 1.png' / View image / Delete image / Mkdir '/My Directory' | ||
- In subdir : MkFile '/My Directory/My text file 2.txt' / List / Edit / Download / Delete / Upload '/My Directory/My image file 2.png' / View image / Mkdir '/My Directory/My Subdirectory' | ||
- Delete root folder '/My Directory' | ||
- Create nested file '/My folder/My test file.txt' and delete file 'My test file.txt' | ||
|
||
## Credits | ||
vdeconinck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Original version of FSBrowser written by me-no-dev, contributions over time by various contributors | ||
- Icons are from https://feathericons.com/ . The resulting PNG is passed first through https://compresspng.com/ before being converted to base64 using https://www.base64-image.de/ | ||
- The spinner is based on https://github.com/jlong/css-spinners | ||
- Minifiying of index.htm is done using the command line version of https://kangax.github.io/html-minifier/ | ||
- Idea of embedding webpage in code borrowed from https://github.com/me-no-dev/ESPAsyncWebServer | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.