[GH-ISSUE #862] Refactor: WiFiManagerParameter render html #729

Open
opened 2026-02-28 01:26:47 +03:00 by kerem · 0 comments
Owner

Originally created by @dontsovcmc on GitHub (Mar 31, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/862

The main problem with customization are a lot of hardcoded WiFiManagerParameter features.

  1. remove Label from Input. It is independent Tag
  2. remove 'id' from user. I can't understand why it can't be 'p1', 'p2', etc..
  3. SSID, Password should be common WiFiInput with some custom html as you need.

I can code it, but the best way to do Unit Tests first.

My idea:

class WiFiParameterBase()
: id, customAttr
String asHTML()

class WiFiLabel() : public WiFiParameterBase
: text, for
String asHTML() # render Label

class WiFiInput() : public WiFiParameterBase
: placeholder, length, value  # type == 'text'
String asHTML() 

class WiFiButton() : public WiFiParameterBase
: text
String asHTML() 

class WiFiRadioButton() : public WiFiParameterBase
: name, value
String asHTML() 
Originally created by @dontsovcmc on GitHub (Mar 31, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/862 The main problem with customization are a lot of hardcoded WiFiManagerParameter features. 1. remove Label from Input. It is independent Tag 2. remove 'id' from user. I can't understand why it can't be 'p1', 'p2', etc.. 3. SSID, Password should be common WiFiInput with some custom html as you need. I can code it, but the best way to do Unit Tests first. My idea: ``` class WiFiParameterBase() : id, customAttr String asHTML() class WiFiLabel() : public WiFiParameterBase : text, for String asHTML() # render Label class WiFiInput() : public WiFiParameterBase : placeholder, length, value # type == 'text' String asHTML() class WiFiButton() : public WiFiParameterBase : text String asHTML() class WiFiRadioButton() : public WiFiParameterBase : name, value String asHTML() ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#729
No description provided.