初始化提交
This commit is contained in:
@@ -0,0 +1,399 @@
|
||||
<!-- HTTP_HEAD -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/>
|
||||
<title>{v}</title>
|
||||
<!-- /HTTP_HEAD -->
|
||||
<!-- HTTP_STYLE -->
|
||||
<style>
|
||||
|
||||
:root{
|
||||
/* CSS VARIABLE THEME COLOR */
|
||||
/*--primarycolor:#9933CC;*/
|
||||
--primarycolor:#1fa3ec;
|
||||
}
|
||||
|
||||
body.invert,
|
||||
body.invert a,
|
||||
body.invert h1 {
|
||||
background-color:#060606;
|
||||
color:white;
|
||||
}
|
||||
body.invert .msg{
|
||||
background-color: #282828;
|
||||
border-top: 1px solid #555;
|
||||
border-right: 1px solid #555;
|
||||
border-bottom: 1px solid #555;
|
||||
color:#fff;
|
||||
}
|
||||
body.invert .q[role=img] {
|
||||
-webkit-filter: invert(1);
|
||||
filter: invert(1);
|
||||
}
|
||||
.c,
|
||||
body {
|
||||
text-align: center;
|
||||
font-family: verdana
|
||||
}
|
||||
.wrap {
|
||||
text-align:left;
|
||||
display:inline-block;
|
||||
min-width:260px;
|
||||
max-width:500px;
|
||||
}
|
||||
div,
|
||||
input,select {
|
||||
padding: 5px;
|
||||
font-size: 1em;
|
||||
/*width: 100%;*/
|
||||
/*/*margin: 3px 0 10px 0; // BEFORE spacing shows label closer to input, but need to do same for AFTER*/
|
||||
margin: 5px 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
div{
|
||||
margin: 5px 0;
|
||||
}
|
||||
input,button,select,.msg{
|
||||
border-radius:.3rem;
|
||||
width: 100%;
|
||||
}
|
||||
input[type=radio],input[type=checkbox]{
|
||||
width: auto;
|
||||
}
|
||||
button,input[type="button"],input[type="submit"] {
|
||||
border: 0;
|
||||
background-color: var(--primarycolor);
|
||||
color: #fff;
|
||||
line-height: 2.4rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
input[type="file"]{
|
||||
border: 1px solid var(--primarycolor);
|
||||
}
|
||||
a {
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: var(--primarycolor);
|
||||
text-decoration: underline;
|
||||
}
|
||||
.h {
|
||||
display: none;
|
||||
}
|
||||
.q {
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
text-align: right;
|
||||
min-width: 38px;
|
||||
float:right;
|
||||
}
|
||||
.q.q-0:after {
|
||||
background-position-x: 0;
|
||||
}
|
||||
.q.q-1:after {
|
||||
background-position-x: -16px;
|
||||
}
|
||||
.q.q-2:after {
|
||||
background-position-x: -32px;
|
||||
}
|
||||
.q.q-3:after {
|
||||
background-position-x: -48px;
|
||||
}
|
||||
.q.q-4:after {
|
||||
background-position-x: -64px;
|
||||
}
|
||||
.q.l:before {
|
||||
background-position-x: -80px;
|
||||
padding-right: 5px
|
||||
}
|
||||
.ql .q {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.q:after,
|
||||
.q:before {
|
||||
content: '';width:16px;height:16px;display:inline-block;background-repeat:no-repeat;background-position: 16px 0;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');
|
||||
}
|
||||
@media (-webkit-min-device-pixel-ratio: 2),
|
||||
(min-resolution: 192dpi) {
|
||||
.q:before,
|
||||
.q:after {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');
|
||||
background-size: 95px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.msg {
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
border: 1px solid #eee;
|
||||
border-left-width: 5px;
|
||||
border-left-color: #777;
|
||||
}
|
||||
|
||||
.msg h4 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.msg.P {
|
||||
border-left-color: var(--primarycolor);
|
||||
}
|
||||
.msg.P h4 {
|
||||
color: var(--primarycolor);
|
||||
}
|
||||
.msg.S {
|
||||
border-left-color: #5cb85c;
|
||||
}
|
||||
.msg.S h4 {
|
||||
color: #5cb85c;
|
||||
}
|
||||
.msg.D {
|
||||
border-left-color: #dc3630;
|
||||
}
|
||||
.msg.D h4 {
|
||||
color: #dc3630;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
dd {
|
||||
margin: 0;
|
||||
padding: 0 0 0.5em 0;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
button.D{
|
||||
background-color:#dc3630;
|
||||
}
|
||||
|
||||
button{
|
||||
/*transition: 0s filter;*/
|
||||
transition: 0s opacity;
|
||||
transition-delay: 3s;
|
||||
transition-duration: 0s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:active{
|
||||
opacity: 50% !important;
|
||||
/*filter: brightness(50%);*/
|
||||
cursor: wait;
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
button:hover{
|
||||
/*opacity: 80%;*/
|
||||
}
|
||||
|
||||
:disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
<!-- /HTTP_STYLE -->
|
||||
<!-- HTTP_SCRIPT -->
|
||||
<script>
|
||||
function c(l){document.getElementById('s').value=l.innerText||l.textContent;
|
||||
p = l.nextElementSibling.classList.contains('l');
|
||||
document.getElementById('p').disabled = !p;
|
||||
if(p)document.getElementById('p').focus()};
|
||||
function f() {var x = document.getElementById('p');x.type==='password'?x.type='text':x.type='password';}
|
||||
</script>
|
||||
<!-- /HTTP_SCRIPT -->
|
||||
<!-- HTTP_HEAD_END -->
|
||||
</head>
|
||||
<body class="invert">
|
||||
<div class='wrap'>
|
||||
<!-- <div class='wrap ql qinv'> -->
|
||||
<!-- /HTTP_HEAD_END -->
|
||||
<!-- SAMPLE -->
|
||||
<h2>/</h2><hR>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- HTTP_PORTAL_OPTIONS -->
|
||||
<!-- /HTTP_PORTAL_OPTIONS -->
|
||||
<!-- HTTP_PORTAL_MENU[] -->
|
||||
<form action='/wifi' method='get'><button>Configure WiFi</button></form><br/>
|
||||
<form action='/0wifi' method='get'><button>Configure WiFi (No Scan)</button></form><br/>
|
||||
<form action='/info' method='get'><button>Info</button></form><br/>
|
||||
<form action='/param' method='get'><button>Setup</button></form><br/>
|
||||
<Hr><br/>
|
||||
<form action='/close' method='post'><button>Close</button></form><br/>
|
||||
<form action='/erase' method='post'><button class='D'>Erase</button></form><br/>
|
||||
<form action='/restart' method='post'><button>Restart</button></form><br/>
|
||||
<form action='/exit' method='post'><button>Exit</button></form><br/>
|
||||
<form action='/' method='post'><button>Back</button></form><br/>
|
||||
<!-- /HTTP_PORTAL_MENU -->
|
||||
<!-- SAMPLE -->
|
||||
<h2>/wifi</h2><hr>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 01</a><div role='img' aria-label='88%' title='88%' class='q q-4 l'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 02</a><div role='img' aria-label='88%' title='88%' class='q q-4'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 03</a><div role='img' aria-label='60%' title='60%' class='q q-3 l'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 04</a><div role='img' aria-label='60%' title='60%' class='q q-3'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 05</a><div role='img' aria-label='60%' title='60%' class='q q-3'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 06</a><div role='img' aria-label='40%' title='40%' class='q q-2'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 07</a><div role='img' aria-label='40%' title='40%' class='q q-2 l'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 08</a><div role='img' aria-label='20%' title='20%' class='q q-1'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 09</a><div role='img' aria-label='20%' title='20%' class='q q-1'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 10</a><div role='img' aria-label='20%' title='20%' class='q q-4 l'></div><div class='q '>100%</div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 11</a><div role='img' aria-label='10%' title='10%' class='q q-3'></div><div class='q '>70%</div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 12</a><div role='img' aria-label='10%' title='10%' class='q q-1 l'></div><div class='q '>10%</div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 13</a><div role='img' aria-label='10%' title='10%' class='q q-0 h'></div><div class='q '>100%</div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 14</a><div class='q'>66%</div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 15</a><div class='q'>56%</div></div>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- HTTP_ITEM -->
|
||||
<div><a href='#p' onclick='c(this)'>{v}</a><div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i}'></div></div>
|
||||
<!-- /HTTP_ITEM -->
|
||||
<!-- HTTP_FORM_START -->
|
||||
<form method='get' action='wifisave'><label for='s'>SSID</label><br/><input id='s' name='s' length=32 placeholder='SSID'><br/><label for='p'>Password</label><input id='p' name='p' length=64 type='password' placeholder='password'><input type='checkbox' onclick='f()'> Show Password<br/>
|
||||
<!-- /HTTP_FORM_START -->
|
||||
<!-- SAMPLE -->
|
||||
<h3>custom parameter</h3><hr>
|
||||
<br/><label for='custom'>Label for Custom Param</label>
|
||||
<br/><input id='custom' name='custom' length='255' placeholder='placeholder' value='' {c}>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- HTTP_FORM_LABEL -->
|
||||
<br/><label for='{i}'>{p}</label>
|
||||
<!-- /HTTP_FORM_LABEL -->
|
||||
<!-- HTTP_FORM_PARAM -->
|
||||
<br/><input id='{i}' name='{n}' length='{l}' placeholder='{p}' value='{v}' {c}>
|
||||
<!-- /HTTP_FORM_PARAM -->
|
||||
<!-- HTTP_FORM_END -->
|
||||
<br/><button type='submit'>Save</button></form>
|
||||
<!-- /HTTP_FORM_END -->
|
||||
<!-- HTTP_SCAN_LINK -->
|
||||
<br/><form action='/wifi' method='get'><button>Refresh</button></form>
|
||||
<!-- /HTTP_SCAN_LINK -->
|
||||
<!-- HTTP_SAVED -->
|
||||
<div class='msg'><h4>Saving Credentials</h4>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>
|
||||
<!-- /HTTP_SAVED -->
|
||||
<!-- HTTP_STATUS_ON -->
|
||||
<div class='msg P'><strong>Connected</strong> to {v}<br/><em><small>with IP {i}</small></em></div>
|
||||
<!-- /HTTP_STATUS_ON -->
|
||||
<!-- HTTP_STATUS_OFF -->
|
||||
<div class='msg {c}'><strong>Not Connected</strong> to {v}{r}</div>
|
||||
<!-- /HTTP_STATUS_OFF -->
|
||||
<!-- sample -->
|
||||
<div class='msg D'><strong>Not Connected</strong> to apname
|
||||
<!-- /sample -->
|
||||
<!-- HTTP_STATUS_OFFPW -->
|
||||
<br/>Authentication Failure
|
||||
<!-- /HTTP_STATUS_OFFPW -->
|
||||
<!-- HTTP_STATUS_OFFNOAP -->
|
||||
<br/>AP not found
|
||||
<!-- /HTTP_STATUS_OFFNOAP -->
|
||||
<!-- HTTP_STATUS_OFFFAIL -->
|
||||
<br/>Could not Connect
|
||||
<!-- /HTTP_STATUS_OFFFAIL -->
|
||||
</div>
|
||||
<!-- HTTP_STATUS_NONE -->
|
||||
<div class='msg'>No AP set</div>
|
||||
<!-- /HTTP_STATUS_NONE -->
|
||||
<!-- SAMPLE -->
|
||||
<div class='msg P'><h4>H4 Color Header P</h4>content</div>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- SAMPLE -->
|
||||
<div class='msg S'><h4>H4 Color Header S</h4>content</div>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- SAMPLE -->
|
||||
<h1>Heading 1</h1>
|
||||
<h2>Heading 2</h2>
|
||||
<h3>Heading 3</h3>
|
||||
<h4>Heading 4</h4>
|
||||
<h3>WIFI HEAD <small><em>(WIFI_OFF)</em></small></h3><hr>
|
||||
<dl>
|
||||
<dt>Chip ID</dt><dd>123456</dd>
|
||||
<dt>Flash Chip ID</dt><dd>1234556</dd>
|
||||
<dt>IDE Flash Size</dt><dd>4194304 bytes</dd>
|
||||
<dt>Real Flash Size</dt><dd>4194304 bytes</dd>
|
||||
<dt>Empty</dt><dd></dd>
|
||||
<dt>Soft AP IP</dt><dd>192.168.4.1</dd>
|
||||
<dt>Soft AP MAC</dt><dd>00:00:00:00:00:00</dd>
|
||||
<dt>Station MAC</dt><dd>00:00:00:00:00:00</dd>
|
||||
</dl>
|
||||
<!-- /SAMPLE -->
|
||||
<!-- HTTP_HELP -->
|
||||
<br/><h3>Available Pages</h3><hr>
|
||||
<table class='table'>
|
||||
<thead><tr><th>Page</th><th>Function</th></tr></thead><tbody>
|
||||
<tr><td><a href='/'>/</a></td>
|
||||
<td>Menu page.</td></tr>
|
||||
<tr><td><a href='/wifi'>/wifi</a></td>
|
||||
<td>Show WiFi scan results and enter WiFi configuration.(/0wifi noscan)</td></tr>
|
||||
<tr><td><a href='/wifisave'>/wifisave</a></td>
|
||||
<td>Save WiFi configuration information and configure device. Needs variables supplied.</td></tr>
|
||||
<tr><td><a href='/close'>/close</a></td>
|
||||
<td>Close the configuration server and configuration WiFi network.</td></tr>
|
||||
<tr><td><a href='/info'>/info</a></td>
|
||||
<td>Information page</td></tr>
|
||||
<tr><td><a href='/close'>/close</a></td>
|
||||
<td>Close the captiveportal popup,configportal will remain active</td></tr>
|
||||
<tr><td><a href='/exit'>/exit</a></td>
|
||||
<td>Exit Config Portal, configportal will close</td></tr>
|
||||
<tr><td><a href='/restart'>/restart</a></td>
|
||||
<td>Reboot the device</td></tr>
|
||||
<tr><td><a href='/erase'>/erase</a></td>
|
||||
<td>Erase WiFi configuration and reboot Device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>
|
||||
</table>
|
||||
<h3>About</h3><hr>
|
||||
Version v1.x.x-xxxxx<Br/>
|
||||
Build_date<br/>
|
||||
Build_file<br/>
|
||||
Arduino_version<br/>
|
||||
<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>
|
||||
<!-- /HTTP_HELP -->
|
||||
<!-- FORM_UPLOAD -->
|
||||
<Br/><br/>Form UPLOAD<br/>
|
||||
<form method='POST' action='u' enctype='multipart/form-data'>
|
||||
<input type='file' name='update' accept='.bin,application/octet-stream' onchange="(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)">
|
||||
<button id='uploadbin' class="h">Submit</button>
|
||||
<a href='http://192.168.4.1' target='_blank'><small>* Upload may not function inside captive portal, Open in browser - http://192.168.4.1</a></small>
|
||||
<!-- /FORM_UPLOAD -->
|
||||
|
||||
|
||||
<!-- FORM_EXTRAS -->
|
||||
<br/><br/><br/><hr>
|
||||
<br/>
|
||||
<label for='custom'>Label for Custom Param</label>
|
||||
<br/>
|
||||
<input id='custom' name='custom' length='255' placeholder='placeholder' value='' {c}>
|
||||
<br/>
|
||||
|
||||
<!-- INOUT CHECKBOX -->
|
||||
<!-- <label for='input_checkbox'>Label for Input Checkbox</label> -->
|
||||
<input id='input_checkbox' name='input_checkbox' placeholder='placeholder' value='' type="checkbox" {c}>
|
||||
<label for='input_checkbox'>Label for Input Checkbox</label>
|
||||
<br/>
|
||||
|
||||
<!-- INPUT CHOICE -->
|
||||
<p>Select Choice</p>
|
||||
<input style='display: inline-block;' type='radio' id='choice1' name='program_selection' value='1'>
|
||||
<label for='choice1'>Choice1</label><br>
|
||||
<input style='display: inline-block;' type='radio' id='choice2' name='program_selection' value='2'>
|
||||
<label for='choice2'>Choice2</label><br>
|
||||
|
||||
<!-- INPUT SELECT -->
|
||||
<br/>
|
||||
<label for='input_select'>Label for Input Select</label>
|
||||
<select name="input_select" id="input_select" class="button">
|
||||
<option value="0">Option 1</option>
|
||||
<option value="1" selected>Option 2</option>
|
||||
<option value="2">Option 3</option>
|
||||
<option value="3">Option 4</option>
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- /FORM_EXTRAS -->
|
||||
|
||||
<!-- HTTP_END -->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<!-- /HTTP_END -->
|
||||
60
arduino-cli/libraries/WiFiManager/extras/parse.js
Normal file
60
arduino-cli/libraries/WiFiManager/extras/parse.js
Normal file
@@ -0,0 +1,60 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
console.log('starting');
|
||||
|
||||
const inFile = 'WiFiManager.template.html';
|
||||
const outFile = 'template.h';
|
||||
|
||||
const defineRegEx = /<!-- ([A-Z_]+) -->/gm;
|
||||
console.log('parsing', inFile);
|
||||
|
||||
fs.readFile(inFile, 'utf8', function (err,data) {
|
||||
if (err) {
|
||||
return console.log(err);
|
||||
}
|
||||
//console.log(data);
|
||||
|
||||
let defines = data.match(defineRegEx);
|
||||
|
||||
//console.log(defines);
|
||||
var stream = fs.createWriteStream(outFile);
|
||||
stream.once('open', function(fd) {
|
||||
for (const i in defines) {
|
||||
|
||||
const start = defines[i];
|
||||
const end = start.replace('<!-- ', '<!-- /')
|
||||
defineRegEx.lastIndex = 0;
|
||||
const constantName = defineRegEx.exec(start)[1];
|
||||
|
||||
console.log(constantName);
|
||||
var extractRE = new RegExp(start + '([\\s\\S]+)' + end, 'gm');
|
||||
let extractArray = extractRE.exec(data);
|
||||
if(extractArray.length > 1) {
|
||||
let def = extractArray[1];
|
||||
//console.log(def);
|
||||
//minimise a bit
|
||||
def = def.replace(/\s+/g, ' ');
|
||||
def = def.replace(/>\s+</g, '><');
|
||||
def = def.trim();
|
||||
//more extraneous spaces - possible bad results, needs to be checked
|
||||
//def = def.replace(/(\w)\s(\W)|(\W)\s(\w)|(\W)\s(\W)/g, '$1$2$3$4$5$6');
|
||||
def = def.replace(/(\w)\s(\W)|(\W)\s(\w)/g, '$1$2$3$4');
|
||||
//escape double quotes
|
||||
def = def.replace(/\\([\s\S])|(")/g, "\\$1$2");
|
||||
|
||||
|
||||
console.log(def);
|
||||
//const char HTTP_HEAD[] PROGMEM =
|
||||
let string = 'const char ' + constantName + '[] PROGMEM';
|
||||
for (let i = string.length; i < 42; i++) {
|
||||
string += ' ';
|
||||
}
|
||||
string += '= "' + def + '";\n';
|
||||
stream.write(string);
|
||||
}
|
||||
}
|
||||
stream.end();
|
||||
});
|
||||
});
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
12
arduino-cli/libraries/WiFiManager/extras/template.h
Normal file
12
arduino-cli/libraries/WiFiManager/extras/template.h
Normal file
@@ -0,0 +1,12 @@
|
||||
const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\"content=\"width=device-width,initial-scale=1,user-scalable=no\"/><title>{v}</title>";
|
||||
const char HTTP_STYLE[] PROGMEM = "<style> .c{text-align:center;}div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align:center;font-family:verdana;}button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;} .q{float:right;width:64px;text-align:right;} .l{background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX///8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6OSk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eAXvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==\")no-repeat left center;background-size:1em;} </style>";
|
||||
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();} </script>";
|
||||
const char HTTP_HEAD_END[] PROGMEM = "</head><body><div style=\"text-align:left;display:inline-block;min-width:260px;\">";
|
||||
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action=\"/wifi\"method=\"get\"><button>Configure WiFi</button></form><br/><form action=\"/0wifi\"method=\"get\"><button>Configure WiFi(No Scan)</button></form><br/><form action=\"/i\"method=\"get\"><button>Info</button></form><br/><form action=\"/r\"method=\"post\"><button>Reset</button></form>";
|
||||
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p'onclick='c(this)'>{v}</a> <span class='q{i}'>{r}%</span></div>";
|
||||
const char HTTP_FORM_START[] PROGMEM = "<form method='get'action='wifisave'><input id='s'name='s'length=32 placeholder='SSID'><br/><input id='p'name='p'length=64 type='password'placeholder='password'><br/>";
|
||||
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}'name='{n}'length={l}placeholder='{p}'value='{v}' {c}>";
|
||||
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>save</button></form>";
|
||||
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><div class=\"c\"><a href=\"/wifi\">Scan</a></div>";
|
||||
const char HTTP_SAVED[] PROGMEM = "<div>Credentials Saved<br/>Trying to connect ESP to network.<br/>If it fails reconnect to AP to try again</div>";
|
||||
const char HTTP_END[] PROGMEM = "</div></body></html>";
|
||||
182
arduino-cli/libraries/WiFiManager/extras/test.html
Normal file
182
arduino-cli/libraries/WiFiManager/extras/test.html
Normal file
@@ -0,0 +1,182 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<title>Config ESP</title>
|
||||
<script>
|
||||
|
||||
function c(l,e) {
|
||||
console.log(l);
|
||||
// preventDefault();
|
||||
document.getElementById('s').value = l.innerText || l.textContent;
|
||||
// document.location.href = document.location +"#wmform";
|
||||
p = l.nextElementSibling.classList.contains("l");
|
||||
document.getElementById('p').disabled = !p;
|
||||
if(p)document.getElementById('p').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.c,
|
||||
body {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
div,
|
||||
input {
|
||||
padding: 5px;
|
||||
font-size: 1em
|
||||
}
|
||||
|
||||
input {
|
||||
width: 95%
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: verdana
|
||||
}
|
||||
|
||||
button {
|
||||
border: 0;
|
||||
border-radius: .3rem;
|
||||
background-color: #1fa3ec;
|
||||
color: #fff;
|
||||
line-height: 2.4rem;
|
||||
font-size: 1.2rem;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #1fa3ec;
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
.q {
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
text-align: right;
|
||||
min-width: 38px
|
||||
}
|
||||
|
||||
.q.q-0:after {
|
||||
background-position-x: 0
|
||||
}
|
||||
|
||||
.q.q-1:after {
|
||||
background-position-x: -16px
|
||||
}
|
||||
|
||||
.q.q-2:after {
|
||||
background-position-x: -32px
|
||||
}
|
||||
|
||||
.q.q-3:after {
|
||||
background-position-x: -48px
|
||||
}
|
||||
|
||||
.q.q-4:after {
|
||||
background-position-x: -64px
|
||||
}
|
||||
|
||||
.q.l:before {
|
||||
background-position-x: -80px;
|
||||
padding-right: 5px
|
||||
}
|
||||
|
||||
.ql .q {
|
||||
float: left
|
||||
}
|
||||
|
||||
.qr .q {
|
||||
float: right
|
||||
}
|
||||
|
||||
.qinv .q {
|
||||
-webkit-filter: invert(1);
|
||||
filter: invert(1)
|
||||
}
|
||||
|
||||
.q:after,
|
||||
.q:before {
|
||||
content: '';
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: inline-block;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 16px 0;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');
|
||||
}
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 2),
|
||||
(min-resolution: 192dpi) {
|
||||
.q:before,
|
||||
.q:after {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');
|
||||
background-size: 95px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- classes, left/right invert -->
|
||||
<div class="qr" style='text-align:left;display:inline-block;min-width:260px;'>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 01</a><div role='img' aria-label='88%' title='88%' class='q q-4 l'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 02</a><div role='img' aria-label='88%' title='88%' class='q q-4'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 03</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 04</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 05</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 06</a><div role='img' aria-label='88%' title='88%' class='q q-2'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 07</a><div role='img' aria-label='88%' title='88%' class='q q-2'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 08</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 09</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 10</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 11</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 12</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 13</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
|
||||
<div><a href='#p' onclick='c(this)'>Access Point 14</a><div role='img' aria-label='88%' title='88%' class='q q-0 l'></div></div>
|
||||
<br/>
|
||||
<form id="wmform" method='get' action='wifisave'>
|
||||
<input id='s' name='s' length=32 placeholder='SSID'>
|
||||
<br/>
|
||||
<input id='p' name='p' length=64 type='password' placeholder='password'>
|
||||
<br/>
|
||||
<br/>
|
||||
<input id='server' name='server' length=4 placeholder='mqtt server' value=''>
|
||||
<br/>
|
||||
<input id='port' name='port' length=5 placeholder='mqtt port' value='8080'>
|
||||
<br/>
|
||||
<input id='blynk' name='blynk' length=3 placeholder='blynk token' value='YOUR_BLYNK_TOKEN'>
|
||||
<br/>
|
||||
<br/>
|
||||
<input id='ip' name='ip' length=15 placeholder='Static IP' value='10.0.1.56'>
|
||||
<br/>
|
||||
<input id='gw' name='gw' length=15 placeholder='Static Gateway' value='10.0.1.1'>
|
||||
<br/>
|
||||
<input id='sn' name='sn' length=15 placeholder='Subnet' value='255.255.255.0'>
|
||||
<br/>
|
||||
<br/>
|
||||
<button type='submit'>save</button>
|
||||
</form>
|
||||
<br/>
|
||||
<div class="c"><a href="/wifi">Scan</a></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user