pull/8/head
Hieromon Ikasamo 7 years ago
parent 7817433eac
commit c68b1d6619
  1. BIN
      docs/images/PageBuilder.png
  2. 79
      examples/Credential/Credential.ino
  3. 10
      examples/HandleClient/HandleClient.ino
  4. 10
      examples/HandlePortal/HandlePortal.ino
  5. 76
      examples/HandlePortalEX/HandlePortalEX.ino
  6. 2
      library.json
  7. 2
      library.properties
  8. BIN
      mkdocs/images/PageBuilder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 251 KiB

@ -41,47 +41,48 @@ String delCredential(PageArgument&);
* The number of the entry to be deleted is passed to the function in the
* POST method.
*/
static const char html[] PROGMEM = {
"<!DOCTYPE html>"
"<html>"
"<head>"
"<meta charset=\"UTF-8\" name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
"<style>"
"html {"
"font-family:Helvetica,Arial,sans-serif;"
"-ms-text-size-adjust:100%;"
"-webkit-text-size-adjust:100%;"
"}"
"a:link, a:visited {"
"background-color: #2f4f4f;"
"border-radius: 4px;"
"color: white;"
"display: inline-block;"
"padding: 6px 12px;"
"text-align: center;"
"text-decoration: none;"
"}"
"a:hover, a:active {"
"background-color: #132020;"
"}"
"</style>"
"</head>"
"<body>"
"<form action=\"/del\" method=\"POST\">"
"<ol>"
"{{SSID}}"
"</ol>"
"<p>Enter deleting entry:</p>"
"<input type=\"number\" min=\"1\" name=\"num\">"
"<input type=\"submit\">"
"</form>"
"<p><a href=\"" AUTOCONNECT_URI "\">Menu</a></p>"
"</body>"
"</html>"
};
static const char PROGMEM html[] = R"*lit(
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">
<style>
html {
font-family:Helvetica,Arial,sans-serif;
-ms-text-size-adjust:100%;
-webkit-text-size-adjust:100%;
}
.menu > a:link {
position: absolute;
display: inline-block;
right: 12px;
padding: 0 6px;
text-decoration: none;
}
</style>
</head>
<body>
<div class="menu">{{AUTOCONNECT_MENU}}</div>
<form action="/del" method="POST">
<ol>
{{SSID}}
</ol>
<p>Enter deleting entry:</p>
<input type="number" min="1" name="num">
<input type="submit">
</form>
</body>
</html>
)*lit";
static const char PROGMEM autoconnectMenu[] = { AUTOCONNECT_LINK(BAR_24) };
// URL path as '/'
PageElement elmList(html, {{ "SSID", viewCredential }});
PageElement elmList(html,
{{ "SSID", viewCredential },
{ "AUTOCONNECT_MENU", [](PageArgument& args) {
return String(FPSTR(autoconnectMenu));} }
});
PageBuilder rootPage("/", { elmList });
// URL path as '/del'

@ -26,8 +26,12 @@ void handleRoot() {
"font-family:'Arial',sans-serif;"
"text-align:center;"
"}"
".menu {"
"text-align:right;"
".menu > a:link {"
"position: absolute;"
"display: inline-block;"
"right: 12px;"
"padding: 0 6px;"
"text-decoration: none;"
"}"
".button {"
"display:inline-block;"
@ -41,7 +45,7 @@ void handleRoot() {
"</style>"
"</head>"
"<body>"
"<p class=\"menu\">" AUTOCONNECT_LINK(BAR_32) "</p>"
"<div class=\"menu\">" AUTOCONNECT_LINK(BAR_24) "</div>"
"BUILT-IN LED<br>"
"GPIO(");
page += String(BUILTIN_LED);

@ -32,8 +32,12 @@ void handleRoot() {
"font-family:'Arial',sans-serif;"
"text-align:center;"
"}"
".menu {"
"text-align:right;"
".menu > a:link {"
"position: absolute;"
"display: inline-block;"
"right: 12px;"
"padding: 0 6px;"
"text-decoration: none;"
"}"
".button {"
"display:inline-block;"
@ -47,7 +51,7 @@ void handleRoot() {
"</style>"
"</head>"
"<body>"
"<p class=\"menu\">" AUTOCONNECT_LINK(BAR_32) "</p>"
"<div class=\"menu\">" AUTOCONNECT_LINK(BAR_32) "</div>"
"BUILT-IN LED<br>"
"GPIO(");
page += String(BUILTIN_LED);

@ -23,39 +23,45 @@
ESP8266WebServer server;
AutoConnect portal(server);
static const char mold_page[] PROGMEM = {
"<html>"
"</head>"
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
"<style type=\"text/css\">"
"body {"
"-webkit-appearance:none;"
"-moz-appearance:none;"
"font-family:'Arial',sans-serif;"
"text-align:center;"
"}"
".menu {"
"text-align:right;"
"}"
".button {"
"display:inline-block;"
"border-radius:7px;"
"background:#73ad21;"
"margin:0 10px 0 10px;"
"padding:10px 20px 10px 20px;"
"text-decoration:none;"
"color:#000000;"
"}"
"</style>"
"</head>"
"<body>"
"<p class=\"menu\">" AUTOCONNECT_LINK(BAR_32) "</p>"
"BUILT-IN LED<br>"
"GPIO({{LED}}) : <span style=\"font-weight:bold;color:{{COLOR}}\">{{GPIO}}</span>"
"<p><a class=\"button\" href=\"/io?v=low\">low</a><a class=\"button\" href=\"/io?v=high\">high</a></p>"
"</body>"
"</html>"
};
static const char PROGMEM mold_page[] = R"*lit(
<html>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {
-webkit-appearance:none;
-moz-appearance:none;
font-family:'Arial',sans-serif;
text-align:center;
}
.menu > a:link {
position: absolute;
display: inline-block;
right: 12px;
padding: 0 6px;
text-decoration: none;
}
.button {
display:inline-block;
border-radius:7px;
background:#73ad21;
margin:0 10px 0 10px;
padding:10px 20px 10px 20px;
text-decoration:none;
color:#000000;
}
</style>
</head>
<body>
<div class="menu">{{AUTOCONNECT_MENU}}</div>
BUILT-IN LED<br>
GPIO({{LED}}) : <span style="font-weight:bold;color:{{COLOR}}">{{GPIO}}</span>
<p><a class="button" href="/io?v=low">low</a><a class="button" href="/io?v=high">high</a></p>
</body>
</html>
)*lit";
static const char PROGMEM autoconnectMenu[] = { AUTOCONNECT_LINK(BAR_24) };
String getLEDPort(PageArgument& args) {
return String(BUILTIN_LED);
@ -72,7 +78,9 @@ String readLEDPort(PageArgument& args) {
PageElement elm_gpio(mold_page, {
{"LED", getLEDPort},
{"COLOR", setColor},
{"GPIO", readLEDPort}
{"GPIO", readLEDPort},
{"AUTOCONNECT_MENU", [](PageArgument& args) {
return String(FPSTR(autoconnectMenu));}}
});
PageBuilder root("/", { elm_gpio });

@ -17,6 +17,6 @@
],
"frameworks": "arduino",
"platforms": "espressif8266",
"version": "0.9.1",
"version": "0.9.2",
"license": "MIT"
}

@ -1,5 +1,5 @@
name=AutoConnect
version=0.9.1
version=0.9.2
author=Hieromon Ikasamo <hieromon@gmail.com>
maintainer=Hieromon Ikasamo <hieromon@gmail.com>
sentence=ESP8266 WLAN configuration at runtime with web interface.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 251 KiB

Loading…
Cancel
Save