ESPAsyncWiFiManager icon indicating copy to clipboard operation
ESPAsyncWiFiManager copied to clipboard

Considering moving captive portal page to a template in SPIFFS

Open hillct opened this issue 6 years ago • 5 comments

Is there a design goal that precludes taking advantage of the built-in template engine in ESPAsyncWebServer to store and server the captive portal template content from SPIFFS? I ask this before I undertake to do so, in case there are compelling reasons not to do so. While my first thought was for dependencies, it seems all those dependencies (fs.h and hardware that supports SPIFFS, I guess) are baked into ESPAsyncWebServer already, so that shouldn't play into it. Are there other considerations I'm overlooking?

The obvious advantage to serving that content out of SPIFFS, is the ability to highly customize the portal appearance without need to modify the library directly.

hillct avatar Jul 31 '18 19:07 hillct

I don’t think the templating system existed when I wrote this library. Sounds like a great idea. Do you want to take a pass at it and submit a pull request? I won’t have time to look at it for a few weeks.

alanswx avatar Aug 01 '18 22:08 alanswx

I have one other project ahead of this in the queue, but I'll be able to take a look at that migration, thereafter.

hillct avatar Aug 05 '18 22:08 hillct

I wonder if we should either add a new method or fail back if the template isn’t on the spiffs.

alanswx avatar Aug 08 '18 12:08 alanswx

I'd prefer conditional if that route is taken. Would be nice to compile the library without the template overhead and strictly rely upon SPIFFS content. Accordingly, if you have a device which expects content on SPIFFS and its not available, this is a bug with the application. Meaning the SPIFFS files have not been provided to the device. IMOHO, the correct solution is to uploadfs rather than fallback with an improperly burned device.

By allowing a conditional default to include everything in the library, it makes it newbie friendly. As I wouldn't expect many to know about uploadfs type options. But for the more advanced, there isn't a legit reason to needlessly carry the extra burden on the device.

gcopeland avatar Oct 20 '19 18:10 gcopeland

If someone wants to contribute this, it would be great.

alanswx avatar Oct 22 '19 22:10 alanswx