122 lines
6.5 KiB
C
122 lines
6.5 KiB
C
|
// file:///I:/MyProjects/PB_ESP8266_WiFiConfig_Vyvoj/doc/_testy/s?_s=SSID1&_p=heslo&_n=jmeno_zarizeni&_a=on&_st=on&_i=192.168.1.1&_m=255.255.255.0&_g=192.168.1.3&_d=192.168.1.3&{n}={v}
|
||
|
static const char TEXTHTML[] PROGMEM = "text/html";
|
||
|
|
||
|
static const char PAGE_INDEX1[] PROGMEM = R"=====(
|
||
|
<!DOCTYPE html><html lang="en"><head><meta charset= "utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||
|
<title>xPablo.cz Setup</title>
|
||
|
<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;}
|
||
|
#rssiBar{width: 100px;height: 15px;background: #fff;}
|
||
|
#rssiBar > div{width: 52px;height: 15px;background: #c20000;}
|
||
|
</style>
|
||
|
<script>
|
||
|
function c(l){document.getElementById('_s').value=l.innerText||l.textContent;document.getElementById('_p').focus();}
|
||
|
function hAP(){if (document.getElementById('_a').checked){document.getElementById('apconfig').style.display = 'block';}else{document.getElementById('apconfig').style.display = 'none';}}
|
||
|
function hSC(){if (document.getElementById('_st').checked){document.getElementById('staticip').style.display = 'block';}else{document.getElementById('staticip').style.display = 'none';}}
|
||
|
</script>
|
||
|
</head><body><h1>ESP8266 WiFiConfig</h1><div style='text-align:left;display:inline-block;min-width:260px;'>
|
||
|
)=====";
|
||
|
|
||
|
/* Polozky nalezenych SSID
|
||
|
{v} - SSID
|
||
|
{a} - RSSI (primo v dBm)
|
||
|
{s} - bud nic, nebo 'l'>
|
||
|
*/
|
||
|
static const char SSID_ITEM[] PROGMEM = R"=====(
|
||
|
<div><a href='#p' onclick='c(this)'>{v}</a> <span class='q {s}'><meter value="{a}" min="0" max="100" low="30" high="80" optimum="50" style="width: 70%;"></meter></span></div>
|
||
|
)=====";
|
||
|
|
||
|
/* Zacatek formulare pro vyplneni
|
||
|
{s} - SSID
|
||
|
{p} - password
|
||
|
{n} - Netbios name
|
||
|
{a} - AP mode (checkbox)
|
||
|
{ch}- cislo kanalu AP
|
||
|
{c} - staticka IP konfigurace (checkbox)
|
||
|
{i} - ip adresa
|
||
|
{m} - maska
|
||
|
{g} - brana
|
||
|
{d} - dns server
|
||
|
*/
|
||
|
static const char PAGE_INDEX2[] PROGMEM = R"=====(
|
||
|
<form method='post' action='s'>
|
||
|
<label>SSID<br><input id='_s' name='_s' maxlength=32 required {s}></label><br>
|
||
|
<label>Heslo<br><input id='_p' name='_p' maxlength=64 {p} type='password'></label><br>
|
||
|
<label>Jméno zařízení<br><input name='_n' maxlength=32 pattern='^[a-zA-Z][a-zA-Z0-9-_\\.]{1,32}$' title='Jméno dle NetBios konvence (max. 16 znaků písmena, čísla a znaky "_.")' {n}></label><br>
|
||
|
<div>
|
||
|
<label><input id='_a' name='_a' type='checkbox' style="width: 10%; float: left; margin-top: 5px;" onclick='hAP();' {a}>Režim AP</label>
|
||
|
<div id="apconfig">
|
||
|
<label>Kanál<br><input type="number" name="_ch" min="1" max="13" title='cislo kanalu v intervalu 1-13' value='{ch}'></label><br>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<label><input id='_st' name='_st' type='checkbox' style="width: 10%; float: left; margin-top: 5px;" onclick='hSC();' {a}>Staticka IP konfigurace</label>
|
||
|
<div id="staticip">
|
||
|
<label>IP adresa<br><input type="text" name="_i" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{i}'></label><br>
|
||
|
<label>Síťová maska<br><input type="text" name="_m" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{m}'></label><br>
|
||
|
<label>Síťová brána<br><input type="text" name="_g" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{g}'></label><br>
|
||
|
<label>Server DNS<br><input type="text" name="_d" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{d}'></label><br>
|
||
|
</div>
|
||
|
</div>
|
||
|
<script>hAP();hSC();</script>
|
||
|
)=====";
|
||
|
|
||
|
// Uzivatelsky pridane polozky
|
||
|
static const char PAGE_PARAM_HDR[] PROGMEM = R"=====(
|
||
|
<hr>
|
||
|
<h2>Uživatelské položky</h2>
|
||
|
)=====";
|
||
|
|
||
|
static const char PAGE_PARAM[] PROGMEM = R"=====(
|
||
|
<label>{t}<br><input name='{n}' maxlength='{l}' value='{v}'></label><br>
|
||
|
)=====";
|
||
|
|
||
|
// Konec formulare a stranky
|
||
|
static const char PAGE_END[] PROGMEM = R"=====(
|
||
|
<br>
|
||
|
<button type='submit'>Uložit a restartovat</button></form>
|
||
|
</div></body></html>
|
||
|
)=====";
|
||
|
|
||
|
// Nenalezeno zadne SSID
|
||
|
static const char PAGE_NO_SSID[] PROGMEM = R"=====(
|
||
|
<div>Nenalezená žádná síť. Občerstvi stránku pro nové hledání.</div>
|
||
|
)=====";
|
||
|
|
||
|
// Konfigurace ulozena - restartuji...
|
||
|
static const char PAGE_SAVED[] PROGMEM = R"=====(
|
||
|
<!DOCTYPE html><html lang="cs"><head><meta http-equiv="refresh" content="10;url=/"/>
|
||
|
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1"/>
|
||
|
<title>xPablo Setup - Konfigurace uložena</title>
|
||
|
<style>div,input {margin-bottom: 5px;}body{width:200px;display:block;margin-left:auto;margin-right:auto;}</style>
|
||
|
</head><body>
|
||
|
Uloženo do EEPROM...<br/>
|
||
|
Restart za 10 sekund.
|
||
|
</body></html>
|
||
|
)=====";
|
||
|
|
||
|
static const char PAGE_CAPTIVEPORTALCATCH[] PROGMEM = R"=====(
|
||
|
<!DOCTYPE html><html lang="cs"><head><meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/><title>xPablo.cz Setup</title>
|
||
|
<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;}
|
||
|
.vl-info {border-left: thick solid #1fa3ec;background: #cee6ff; text-align:left; display:inline-block; min-width:260px; margin-top:15px}
|
||
|
.red { background-color: #ff0000;}
|
||
|
</style>
|
||
|
</head><body><div style='text-align:left;display:inline-block;min-width:260px;'>
|
||
|
<form action="/config" method="get"><button>Konfigurace WiFi</button></form><br/><form action="/i" method="get"><button>Informace o modulu</button></form><br/><form action="/r" method="post"><button class="red">Reset</button></form><br>
|
||
|
)=====";
|
||
|
|
||
|
// druha cast (mezi 1. a druhou cast muzeme doplnit dodatecne informace)
|
||
|
static const char PAGE_CAPTIVEPORTALCATCH2[] PROGMEM = R"=====(
|
||
|
</div></body></html>
|
||
|
)=====";
|
||
|
|
||
|
static const char PAGE_RESTART[] PROGMEM = R"=====(
|
||
|
Restartuji...
|
||
|
)=====";
|