Revamp of the FSBrowser and SDWebServer examples by vdeconinck · Pull Request #7182 · esp8266/Arduino (original) (raw)

Hi devyte, First, many thanks for the extensive review and advice. Much appreciated.

Rereading some comments, I realize some moves I made may seem to come out of the blue, but this version is really a merge between the original FSBrowser and SDWebServer. For example, the fact that the page is /edit/index.htm and not /edit.htm[.gz] comes from SDWebServer. Same for the recursive deletion routine.
I guess it means I really didn't invent anything, I'm mostly the cook who mixed the right ingredients :-).

With the latest requested changes (and removal of local urlDecode()), I think the version is quite OK.

With respect to the "is the server alive ?" use of /all, I just compiled a FSBrowser for LittleFS while the filesystem was formated as SPIFFS (please note that no formating ever happens anymore in such a case) and all calls return a clean "FS INIT ERROR" message. OTOH, a call to /status returns the status of the filesystem, which in that case was {"type":"LittleFS", "isOk":"false","unsupportedFiles":""}, so I think it's quite usable this way.

Please don't hesitate to test in real life and report of course.

If everything is OK, I now have two PRs on my TODO list:

Regarding that last point, do you still have a html page at hand that calls the graphs.js file ? I would like to know how it's meant to work before refactoring.