{document.title}
\n {teaser > 0 && document.text.length > 0 &&\n \n }\n {document.tags && document.tags.map(tag => (\n {tag}\n ))}\n {teaser > 0 && missing.length > 0 &&\n\n {translation(\"search.result.term.missing\")}: {...missing}\n
\n }\nAutoConnectAux customPage;
AutoConnectElementVT& elements = customPage.getElements();
-for (AutoConnectElement& elm : elements) {
+for (AutoConnectElement& elm : elements) {
if (elm.typeOf() == AC_Text) {
AutoConnectText& text = reinterpret_cast<AutoConnectText&>(elm);
text.style = "color:gray;";
@@ -2524,7 +2526,7 @@ typeAutoConnectAux customPage;
AutoConnectElementVT& elements = customPage.getElements();
-for (AutoConnectElement& elm : elements) {
+for (AutoConnectElement& elm : elements) {
if (elm.type() == AC_Text) {
AutoConnectText& text = customPage[elm.name].as<AutoConnectText>();
text.style = "color:gray;";
@@ -2899,7 +2901,7 @@ Variant for
-
+
@@ -2908,7 +2910,7 @@ Variant for
-
+
{
- "name" : "aux",
- "uri" : "/aux",
- "menu" : true,
- "element" : [
+ "name" : "aux",
+ "uri" : "/aux",
+ "menu" : true,
+ "element" : [
{
"name": "hello",
"type": "ACText",
@@ -2439,8 +2441,8 @@ Overwrite
For example, the combination of the Sketch and JSON document as follows updates only the style while keeping Caption (ie. "Hello, world") as AutoConnectText value.
External JSON document for the below sketch to modify the text style.
{
- "name" : "Caption",
- "type" : "ACText",
+ "name" : "Caption",
+ "type" : "ACText",
"style": "text-align:center;font-size:24px;font-family:'Impact','Futura',sans-serif;color:tomato;"
}
@@ -2470,13 +2472,13 @@ Overwrite
Check data against on submission¶
By giving a pattern to AutoConnectInput, you can find errors in data styles while typing in custom Web pages. The pattern is specified with regular expression.2 If the value during input of AutoConnectInput does not match the regular expression specified in the pattern, its background color changes to pink. The following example shows the behavior when checking the IP address in the AutoConnectInput field.
{
- "title" : "Page-1",
- "uri" : "/page1",
- "menu" : true,
- "element" : [
+ "title" : "Page-1",
+ "uri" : "/page1",
+ "menu" : true,
+ "element" : [
{
- "name" : "Server",
- "type" : "ACInput",
+ "name" : "Server",
+ "type" : "ACInput",
"label": "Server address",
"pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
}
@@ -2925,7 +2927,7 @@ Limitations
-
+
@@ -2934,7 +2936,7 @@ Limitations
-
+
@@ -2947,10 +2949,10 @@ Limitations
You can embed custom Web pages written in JSON into AutoConnect without AutoConnectAux & AutoConnectElements declaration. Custom Web page declaration by JSON can embed in the Sketch as a fixed string or can store in the external file such as SPIFFS for stream loading. Also, you can also load and save AutoConnectElements objects individually.1
@@ -1637,48 +1639,48 @@[
{
- "title" : "Page 1 title",
- "uri" : "/page1",
- "menu" : true,
- "element" : [
+ "title" : "Page 1 title",
+ "uri" : "/page1",
+ "menu" : true,
+ "element" : [
{
- "name" : "caption",
- "type" : "ACText",
- "value" : "hello, world"
+ "name" : "caption",
+ "type" : "ACText",
+ "value" : "hello, world"
},
{
- "name" : "send",
- "type" : "ACSubmit",
- "uri" : "/page2"
+ "name" : "send",
+ "type" : "ACSubmit",
+ "uri" : "/page2"
}
]
},
{
- "title" : "Page 1 title",
- "uri" : "/page2",
- "menu" : false,
- "element" : [
+ "title" : "Page 1 title",
+ "uri" : "/page2",
+ "menu" : false,
+ "element" : [
{
- "name" : "responds",
- "type" : "ACText",
- "value" : "Good day"
+ "name" : "responds",
+ "type" : "ACText",
+ "value" : "Good day"
},
{
- "name" : "send",
- "type" : "ACSubmit",
- "uri" : "/page3"
+ "name" : "send",
+ "type" : "ACSubmit",
+ "uri" : "/page3"
}
]
},
{
- "title" : "Page 3 title",
- "uri" : "/page3",
- "menu" : true,
- "element" : [
+ "title" : "Page 3 title",
+ "uri" : "/page3",
+ "menu" : true,
+ "element" : [
{
- "name" : "responds",
- "type" : "ACText",
- "value" : "bye"
+ "name" : "responds",
+ "type" : "ACText",
+ "value" : "bye"
}
]
}
@@ -2283,7 +2285,7 @@ Saving JSON document
-
+
@@ -2292,7 +2294,7 @@ Saving JSON document
-
+
The Sketch may use authentication to protect custom Web pages and prevent unauthorized access. AutoConnect has implemented HTTP authentication feature that can be applied to multiple scopes using the authentication methods provided by the platform's WebServer library for ESP8266 or ESP32.1
@@ -1342,7 +1344,7 @@AutoConnect aims to connect the ESP module as a station to a WiFi access point and equips with various APIs to maintain a WiFi connection as possible while sketch running. The main APIs are AutoConnect::begin and AutoConnect::handleClient. You can make sketches with flexible WiFi connection capability by properly using these two APIs and the settings by AutoConnectConfig.
@@ -1453,7 +1455,7 @@The default behavior of AutoConnect is to launch the captive portal if 1st-WiFi.begin attempting inside AutoConnect::begin fails. You can change this default behavior through the AutoConnectConfig settings join together with Sketch code that implements to control the WiFi connection attempting.
@@ -1615,7 +1617,7 @@AutoConnect automatically saves the credentials of the established WiFi connection according to the AutoConnectConfig::autoSave settings. The save destination differs depending on the type of ESP module. In the case of ESP8266, it is the EEPROM, and in the case of ESP32, it is the NVS (Non-volatile storage) partition implemented by the Preferences class.
@@ -1258,7 +1260,7 @@
The design of various AutoConnect web pages is basically inflexible. Its appearance and layout don't have many customizable visual aspects but nevertheless, you can customize the following appearances of your AutoConnect web pages:
@@ -1285,7 +1287,7 @@AutoConnect allows you to make the static configuration of SoftAP at runtime. Its configuration includes the identification information on the network such as the IP address and the access path of the Web page handled by AutoConnect etc. In addition, the mDNS service allows SoftAP to be accessed by hostname on the local network.
@@ -1477,7 +1479,7 @@
AutoConnect also has features that are not directly related to WiFi connection abilities. They're mostly like a little accessory but can reduce the amount of sketch code.
@@ -1541,7 +1543,7 @@How to specify the value of the menu items
An menuItems accepts the logical OR of AC_MENUITEM_t type value. For example, to enable only Open SSIDs and HOME items, specify: -
AutoConnectConfig config;
+AutoConnect portal;
+AutoConnectConfig config;
+
config.menuItems = AC_MENUITEM_OPENSSIDS | AC_MENUITEM_HOME;
+portal.config(config);
+
+Also, to enable the credentials removal feature, follow these settings procedures.
+AutoConnect portal;
+AutoConnectConfig config;
+
+config.menuItems = config.menuItems | AC_MENUITEM_DELETESSID;
+portal.config(config);
However, even if you specify like the above, the AutoConnectAux page items still display on the menu. To remove the AutoConnectAux items, use the AutoConnectAux::menu function.
\n {translation(\"search.result.term.missing\")}: {...missing}\n
\n }\n