mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1605] How do I redirect the web browser after making changes in web portal? #1371
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1371
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nospam2k on GitHub (May 11, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1605
When I make changes from Web Portal (not as AP but via wm.startWebPortal), how can I redirect the web browser away from /wifisave back to /.
Right now, when I make updates, the url remains /wifi? unless I manually change it.
It appears when using the reset option as web portal there is no redirect either. Is this by design or am I missing a parameter to tell it to redirect. Obviously the AP portal doesn't need to redirect.
@tablatronix commented on GitHub (May 12, 2023):
Not sure I fully understand the question, are you only changing params, or saving wifi ?
@nospam2k commented on GitHub (May 13, 2023):
When I run the portal and check using wm.process() and then go to the URL /, I get the normal AP menu, but now as a web portal. When I go into wifi and just click save (I do have custom parameters in the wifi menu), I get back the page that just says SAVED. I want it to redirect back to / after like 5 seconds or so.
@Halvhjearne commented on GitHub (May 21, 2023):
@nospam2k idk if there is a better or prefered way to do this, but what i did was redirect back to main page, once you hit the saved message page, by editing this line in wm_strings_en.h:
const char HTTP_PARAMSAVED[] PROGMEM = "<div class='msg S'>Saved<br/></div>";to
const char HTTP_PARAMSAVED[] PROGMEM = "<meta http-equiv='refresh' content='5;url=/' /><div class='msg S'>Saved<br/></div>";basicly just a refresh after 5sec.
if you are not using a params page i guess you may need to edit this line instead?:
const char HTTP_SAVED[] PROGMEM = "<div class='msg'>Saving Credentials<br/>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";@nospam2k commented on GitHub (May 22, 2023):
thx!
@tablatronix commented on GitHub (May 23, 2023):
hmm, I guess I can add this in, I mean if saving wifi it wont do anything since the AP drops out. But do we want it to do the same for parameters? do we go back to params, or home? Do we just add a home button instead?
@nospam2k commented on GitHub (May 23, 2023):
Yea, I agree, where to go next? For me, going back to the home menu seems the most reasonable. Tasmota reboots and goes back to home for almost everything so I've gotten used to that. On an ESP thats just a few seconds.
@nospam2k commented on GitHub (May 23, 2023):
Just a thought, but it might be nice to add this into the web portal as a param on init
@Halvhjearne commented on GitHub (May 23, 2023):
i agree, if there is not already an option for this, it would be nice to have one.
idk about a home button, personally i would not really see any use for it with this.
i think most logical would be just return to main page after a short while, i feel like when you hit save, you already changed everything you needed?
obviously if wifi is saved it makes no difference what it does after, but i guess if wifi fails to connect it could also be usefull, since it would reload the main page at some point when ap is back up again.
if you want to "go wild" with it, you could scrap the whole "saved" landing page, instantly return to main page and have the saved message be like a toast instead.