Skip to content
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

Hiding /setup page #48

Open
spike7638 opened this issue Oct 16, 2024 · 4 comments
Open

Hiding /setup page #48

spike7638 opened this issue Oct 16, 2024 · 4 comments

Comments

@spike7638
Copy link

Looking at lines 24-36 of AsyncFsWebServer.h, it's clear that there's supposed to be a way to say "I really don't want to have a /setup or /edit page." I've tried defining various things like ESP_FS_WS_SETUP or ESP_FS_WS_SETUP_HTM to be zero before #include "AsyncFsWebServer.h", but that leads to compilation errors like this:

In file included from /Users/jhughes/Documents/Projects/TankSensor/Web.h:12,
                 from /Users/jhughes/Documents/Projects/TankSensor/Web.cpp:4:
/Users/jhughes/Documents/Arduino/libraries/async-esp-fs-webserver-master/src/AsyncFsWebServer.h:135:5: error: 'SetupConfigurator' does not name a type
  135 |     SetupConfigurator* setup = nullptr;
      |     ^~~~~~~~~~~~~~~~~
/Users/jhughes/Documents/Arduino/libraries/async-esp-fs-webserver-master/src/AsyncFsWebServer.h:299:79: error: 'MIN_F' was not declared in this scope
  299 |     void addOption(const char *lbl, T val, bool hidden = false,  double min = MIN_F,
      |      
...

Is there a way that this is supposed to be done? By omitting sserver.enableFsCodeEditor(); from my .cpp file, I can get rid of the edit page, but I cannot figure out how to get rid of the setup page.

@spike7638
Copy link
Author

Please ignore this issue. I'll try to build a minimal non-working example and re-ask here or elsewhere.

@IAmOrion
Copy link

fwiw I also want to remove the setup - don't need it in my use case.
The issue however is that creating an AP means it will trigger the captiveportal which is predefined as /setup
Line 687 in AsyncFsWebServer.cpp on v1.0.7

@cotestatnt
Copy link
Owner

I'm sorry, but since it's a need that I've never had, even though I had foreseen this possibility, I never did any tests.

I just committed with the necessary changes.
Obviously, by deactivating the /setup page, the captiveportal will have to be configured to redirect to a different url than /setup and so I added the method void setCaptiveUrl(const Strin& url)

If it will be necessary to access the WiFi, an alternative method to /setup will have to be foreseen to set the credentials.

I'll do some more testing and release a new version as soon as possible.
In the meantime, if you want to try, you can update by downloading the zip file directly from github

@spike7638
Copy link
Author

spike7638 commented Oct 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants