save space for web frontend

- changed <br/> to <br>
- "name" attributes of input, select, textarea, button items are removed and set by their id (only if ID is set and no name tag given)
This commit is contained in:
tammo0 2019-05-31 18:24:56 +02:00
parent 4a3fe89e99
commit 6ee8d6be16
29 changed files with 115 additions and 111 deletions

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Разрешете JavaScript, за да използвате Tasmota"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Минимален фърмуер<br/>моля надградете го"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Минимален фърмуер<br>моля надградете го"
#define D_WEBSERVER_ACTIVE_ON "Уеб сървърът е активен на"
#define D_WITH_IP_ADDRESS "с IP адрес"
#define D_WEBSERVER_STOPPED "Уеб сървърът е спрян"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Pro používání prostředí Tasmota povolte JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMÁLNÍ<br/>prosím zaktualizujte"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMÁLNÍ<br>prosím zaktualizujte"
#define D_WEBSERVER_ACTIVE_ON "Aktivní Web server"
#define D_WITH_IP_ADDRESS "na IP adrese"
#define D_WEBSERVER_STOPPED "Web server zastaven"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "JavaScript aktivieren um Tasmota benutzen zu können"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMUM-Firmware<br/>bitte upgraden"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMUM-Firmware<br>bitte upgraden"
#define D_WEBSERVER_ACTIVE_ON "Web-Server aktiv bei"
#define D_WITH_IP_ADDRESS "mit IP-Adresse"
#define D_WEBSERVER_STOPPED "Web-Server angehalten"

View File

@ -222,7 +222,7 @@
// webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>παρακαλώ αναβαθμίστε"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>παρακαλώ αναβαθμίστε"
#define D_WEBSERVER_ACTIVE_ON "Ενεργός διακομιστής Web στο"
#define D_WITH_IP_ADDRESS "με διεύθυνση IP"
#define D_WEBSERVER_STOPPED "Ο διακομιστής Web σταμάτησε"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>please upgrade"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>please upgrade"
#define D_WEBSERVER_ACTIVE_ON "Web server active on"
#define D_WITH_IP_ADDRESS "with IP address"
#define D_WEBSERVER_STOPPED "Web server stopped"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Habilitar JavaScript para usar Tasmota"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MÍNIMO<br/>actualice por favor"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MÍNIMO<br>actualice por favor"
#define D_WEBSERVER_ACTIVE_ON "Servidor web activo en"
#define D_WITH_IP_ADDRESS "con dirección IP"
#define D_WEBSERVER_STOPPED "Servidor web detenido"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Pour utiliser Tasmota, veuillez activer JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMAL<br/>merci de mettre à jour"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMAL<br>merci de mettre à jour"
#define D_WEBSERVER_ACTIVE_ON "Serveur web actif sur"
#define D_WITH_IP_ADDRESS "avec l'adresse IP"
#define D_WEBSERVER_STOPPED "Serveur web éteint"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "JavaScript - כדי להשתמש בקושחת אסמוטה אנא הפעל"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "קושחה מינימלית<br/>בבקשה אנא שדרג"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "קושחה מינימלית<br>בבקשה אנא שדרג"
#define D_WEBSERVER_ACTIVE_ON "שרת ווב פעיל"
#define D_WITH_IP_ADDRESS "IP עם כתובת"
#define D_WEBSERVER_STOPPED "שרת ווב הופסק"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "A Tasmota használatához engedélyezd a Javascriptet!"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMÁLIS firmware<br/>frissítsd!"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMÁLIS firmware<br>frissítsd!"
#define D_WEBSERVER_ACTIVE_ON "Webszerver aktív:"
#define D_WITH_IP_ADDRESS "IP cím:"
#define D_WEBSERVER_STOPPED "Webszerver leállítva"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Abilitare JavaScript per utilizzare Tasmota"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>effettuare aggiornamento"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>effettuare aggiornamento"
#define D_WEBSERVER_ACTIVE_ON "Web server attivo su"
#define D_WITH_IP_ADDRESS "con indirizzo IP"
#define D_WEBSERVER_STOPPED "Web server arrestato"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Tasmota를 사용하려면 JavaScript를 활성화 하십시오."
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>업그레이드가 필요합니다"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>업그레이드가 필요합니다"
#define D_WEBSERVER_ACTIVE_ON "Web 서버 작동 중"
#define D_WITH_IP_ADDRESS "IP 주소"
#define D_WEBSERVER_STOPPED "Web 서버 멈춤"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Zet JavaScript aan voor Tasmota"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>opwaarderen"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>opwaarderen"
#define D_WEBSERVER_ACTIVE_ON "Webserver actief op"
#define D_WITH_IP_ADDRESS "met IP adres"
#define D_WEBSERVER_STOPPED "Webserver gestopt"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Aby korzystać z Tasmota, włącz obsługę JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Oprogramowanie MINIMAL<br/>proszę uaktualnić"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Oprogramowanie MINIMAL<br>proszę uaktualnić"
#define D_WEBSERVER_ACTIVE_ON "Aktywny serwer Web"
#define D_WITH_IP_ADDRESS "z adresem IP"
#define D_WEBSERVER_STOPPED "Serwer Web zatrzymany"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware mínimo<br/>Atualizar por favor"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware mínimo<br>Atualizar por favor"
#define D_WEBSERVER_ACTIVE_ON "Servidor WEB ativo em"
#define D_WITH_IP_ADDRESS "com o endereço IP"
#define D_WEBSERVER_STOPPED "Servidor WEB parou"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMO firmware<br/>Atualizar Por favor"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMO firmware<br>Atualizar Por favor"
#define D_WEBSERVER_ACTIVE_ON "Servidor WEB ativo em"
#define D_WITH_IP_ADDRESS "com o endereço IP"
#define D_WEBSERVER_STOPPED "Servitor WEB parou"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Прошивка MINIMAL<br/>пожалуйста обновите"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Прошивка MINIMAL<br>пожалуйста обновите"
#define D_WEBSERVER_ACTIVE_ON "Веб-сервер активен"
#define D_WITH_IP_ADDRESS "с IP-адресом"
#define D_WEBSERVER_STOPPED "Веб-сервер остановлен"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Pre používanie prostredia Tasmota povoľte JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMÁLNY<br/>prosím aktualizujte"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMÁLNY<br>prosím aktualizujte"
#define D_WEBSERVER_ACTIVE_ON "Aktívny Web server"
#define D_WITH_IP_ADDRESS "na IP adrese"
#define D_WEBSERVER_STOPPED "Web server zastavený"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "För att använda Tasmota, aktivera JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br/>var god uppgradera"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "MINIMAL firmware<br>var god uppgradera"
#define D_WEBSERVER_ACTIVE_ON "Webbserver aktiv på"
#define D_WITH_IP_ADDRESS "med IP-adress"
#define D_WEBSERVER_STOPPED "Webbserver stoppad"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Donanım yazılımı çok düşük<br/>lütfen yükseltin"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Donanım yazılımı çok düşük<br>lütfen yükseltin"
#define D_WEBSERVER_ACTIVE_ON "Web sunucusu aktif"
#define D_WITH_IP_ADDRESS "IP adres ile"
#define D_WEBSERVER_STOPPED "Web sunucusu durdu"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Прошивка MINIMAL<br/>будь-ласка оновіть"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Прошивка MINIMAL<br>будь-ласка оновіть"
#define D_WEBSERVER_ACTIVE_ON "Веб-сервер активний"
#define D_WITH_IP_ADDRESS "з IP-адресом"
#define D_WEBSERVER_STOPPED "Веб-сервер зупинений"

View File

@ -222,7 +222,7 @@
// webserver.ino
#define D_NOSCRIPT "Tasmota要求浏览器支持 JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "当前是精简版固件<br/>请升级"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "当前是精简版固件<br>请升级"
#define D_WEBSERVER_ACTIVE_ON "Web 服务器地址:"
#define D_WITH_IP_ADDRESS "IP 地址:"
#define D_WEBSERVER_STOPPED "Web 服务已停止"

View File

@ -222,7 +222,7 @@
// xdrv_02_webserver.ino
#define D_NOSCRIPT "To use Tasmota, please enable JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "固件版本過低<br/>請升級"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "固件版本過低<br>請升級"
#define D_WEBSERVER_ACTIVE_ON "Web服務器:"
#define D_WITH_IP_ADDRESS "IP地址:"
#define D_WEBSERVER_STOPPED "Web 服務器已停止"

View File

@ -57,7 +57,11 @@ const char HTTP_HEAD[] PROGMEM =
"var x=null,lt,to,tp,pc='';" // x=null allow for abortion
"function eb(s){"
"return document.getElementById(s);" // Save code space
"}";
"}"
"function idn(){"
"var t=0,i=document.querySelectorAll('input,button,textarea,select'); while(i.length>=t){ if(i[t]) {i[t]['name']=(i[t].hasAttribute('id')&&(!i[t].hasAttribute('name')))?i[t]['id']:i[t]['name'];}t++;}"
"}"
"window.onload=idn;";
const char HTTP_SCRIPT_COUNTER[] PROGMEM =
"var cn=180;" // seconds
@ -277,7 +281,7 @@ const char HTTP_HEAD_STYLE3[] PROGMEM =
#ifdef FIRMWARE_MINIMAL
"<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING
#endif
"<div style='text-align:center;'><noscript>" D_NOSCRIPT "<br/></noscript>"
"<div style='text-align:center;'><noscript>" D_NOSCRIPT "<br></noscript>"
#ifdef LANGUAGE_MODULE_NAME
"<h3>" D_MODULE " %s</h3>"
#else
@ -292,14 +296,14 @@ const char HTTP_MSG_SLIDER2[] PROGMEM =
"<div><span class='p'>" D_DARKLIGHT "</span><span class='q'>" D_BRIGHTLIGHT "</span></div>"
"<div><input type='range' min='1' max='100' value='%d' onchange='lb(value)'></div>";
const char HTTP_MSG_RSTRT[] PROGMEM =
"<br/><div style='text-align:center;'>" D_DEVICE_WILL_RESTART "</div><br/>";
"<br><div style='text-align:center;'>" D_DEVICE_WILL_RESTART "</div><br>";
const char HTTP_FORM_LOGIN[] PROGMEM =
"<fieldset>"
"<form method='post' action='/'>"
"<p><b>" D_USER "</b><br/><input name='USER1' placeholder='" D_USER "'></p>"
"<p><b>" D_PASSWORD "</b><br/><input name='PASS1' type='password' placeholder='" D_PASSWORD "'></p>"
"<br/>"
"<p><b>" D_USER "</b><br><input name='USER1' placeholder='" D_USER "'></p>"
"<p><b>" D_PASSWORD "</b><br><input name='PASS1' type='password' placeholder='" D_PASSWORD "'></p>"
"<br>"
"<button>" D_OK "</button>"
"</form></fieldset>";
@ -307,84 +311,84 @@ const char HTTP_FORM_TEMPLATE[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_TEMPLATE_PARAMETERS "&nbsp;</b></legend>"
"<form method='get' action='tp'>";
const char HTTP_FORM_TEMPLATE_FLAG[] PROGMEM =
"<p></p>" // Keep close so do not use <br/>
"<p></p>" // Keep close so do not use <br>
"<fieldset><legend><b>&nbsp;" D_TEMPLATE_FLAGS "&nbsp;</b></legend><p>"
// "<input id='c0' name='c0' type='checkbox'><b>" D_OPTION_TEXT "</b><br/>"
// "<input id='c0' name='c0' type='checkbox'><b>" D_OPTION_TEXT "</b><br>"
"</p></fieldset>";
const char HTTP_FORM_MODULE[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_MODULE_PARAMETERS "&nbsp;</b></legend>"
"<form method='get' action='md'>"
"<p></p><b>" D_MODULE_TYPE "</b> (%s)<br/><select id='g99' name='g99'></select><br/>"
"<br/><table>";
"<p></p><b>" D_MODULE_TYPE "</b> (%s)<br><select id='g99'></select><br>"
"<br><table>";
const char HTTP_FORM_WIFI[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_WIFI_PARAMETERS "&nbsp;</b></legend>"
"<form method='get' action='wi'>"
"<p><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br/><input id='s1' name='s1' placeholder='" STA_SSID1 "' value='%s'></p>"
"<p><b>" D_AP1_PASSWORD "</b><br/><input id='p1' name='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br/><input id='s2' name='s2' placeholder='" STA_SSID2 "' value='%s'></p>"
"<p><b>" D_AP2_PASSWORD "</b><br/><input id='p2' name='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_HOSTNAME "</b> (%s)<br/><input id='h' name='h' placeholder='%s' value='%s'></p>";
"<p><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br><input id='s1' placeholder='" STA_SSID1 "' value='%s'></p>"
"<p><b>" D_AP1_PASSWORD "</b><br><input id='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br><input id='s2' placeholder='" STA_SSID2 "' value='%s'></p>"
"<p><b>" D_AP2_PASSWORD "</b><br><input id='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_HOSTNAME "</b> (%s)<br><input id='h' placeholder='%s' value='%s'></p>";
const char HTTP_FORM_LOG1[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_LOGGING_PARAMETERS "&nbsp;</b>"
"</legend><form method='get' action='lg'>";
const char HTTP_FORM_LOG2[] PROGMEM =
"<p><b>" D_SYSLOG_HOST "</b> (" SYS_LOG_HOST ")<br/><input id='lh' name='lh' placeholder='" SYS_LOG_HOST "' value='%s'></p>"
"<p><b>" D_SYSLOG_PORT "</b> (" STR(SYS_LOG_PORT) ")<br/><input id='lp' name='lp' placeholder='" STR(SYS_LOG_PORT) "' value='%d'></p>"
"<p><b>" D_TELEMETRY_PERIOD "</b> (" STR(TELE_PERIOD) ")<br/><input id='lt' name='lt' placeholder='" STR(TELE_PERIOD) "' value='%d'></p>";
"<p><b>" D_SYSLOG_HOST "</b> (" SYS_LOG_HOST ")<br><input id='lh' placeholder='" SYS_LOG_HOST "' value='%s'></p>"
"<p><b>" D_SYSLOG_PORT "</b> (" STR(SYS_LOG_PORT) ")<br><input id='lp' placeholder='" STR(SYS_LOG_PORT) "' value='%d'></p>"
"<p><b>" D_TELEMETRY_PERIOD "</b> (" STR(TELE_PERIOD) ")<br><input id='lt' placeholder='" STR(TELE_PERIOD) "' value='%d'></p>";
const char HTTP_FORM_OTHER[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_OTHER_PARAMETERS "&nbsp;</b></legend>"
"<form method='get' action='co'>"
"<p></p>"
"<fieldset><legend><b>&nbsp;" D_TEMPLATE "&nbsp;</b></legend>"
"<p><input id='t1' name='t1' placeholder='" D_TEMPLATE "' value='%s'></p>"
"<p><input id='t2' name='t2' type='checkbox'%s><b>" D_ACTIVATE "</b></p>"
"<p><input id='t1' placeholder='" D_TEMPLATE "' value='%s'></p>"
"<p><input id='t2' type='checkbox'%s><b>" D_ACTIVATE "</b></p>"
"</fieldset>"
"<br/>"
"<b>" D_WEB_ADMIN_PASSWORD "</b><br/><input id='wp' name='wp' type='password' placeholder='" D_WEB_ADMIN_PASSWORD "' value='" D_ASTERIX "'><br/>"
"<br>"
"<input id='b1' name='b1' type='checkbox'%s><b>" D_MQTT_ENABLE "</b><br/>"
"<br/>";
"<b>" D_WEB_ADMIN_PASSWORD "</b><br><input id='wp' type='password' placeholder='" D_WEB_ADMIN_PASSWORD "' value='" D_ASTERIX "'><br>"
"<br>"
"<input id='b1' type='checkbox'%s><b>" D_MQTT_ENABLE "</b><br>"
"<br>";
const char HTTP_FORM_END[] PROGMEM =
"<br/>"
"<br>"
"<button name='save' type='submit' class='button bgrn'>" D_SAVE "</button>"
"</form></fieldset>";
const char HTTP_FORM_RST[] PROGMEM =
"<div id='f1' name='f1' style='display:block;'>"
"<div id='f1' style='display:block;'>"
"<fieldset><legend><b>&nbsp;" D_RESTORE_CONFIGURATION "&nbsp;</b></legend>";
const char HTTP_FORM_UPG[] PROGMEM =
"<div id='f1' name='f1' style='display:block;'>"
"<div id='f1' style='display:block;'>"
"<fieldset><legend><b>&nbsp;" D_UPGRADE_BY_WEBSERVER "&nbsp;</b></legend>"
"<form method='get' action='u1'>"
"<br/><b>" D_OTA_URL "</b><br/><input id='o' name='o' placeholder='OTA_URL' value='%s'><br/>"
"<br/><button type='submit'>" D_START_UPGRADE "</button></form>"
"</fieldset><br/><br/>"
"<br><b>" D_OTA_URL "</b><br><input id='o' placeholder='OTA_URL' value='%s'><br>"
"<br><button type='submit'>" D_START_UPGRADE "</button></form>"
"</fieldset><br><br>"
"<fieldset><legend><b>&nbsp;" D_UPGRADE_BY_FILE_UPLOAD "&nbsp;</b></legend>";
const char HTTP_FORM_RST_UPG[] PROGMEM =
"<form method='post' action='u2' enctype='multipart/form-data'>"
"<br/><input type='file' name='u2'><br/>"
"<br/><button type='submit' onclick='eb(\"f1\").style.display=\"none\";eb(\"f2\").style.display=\"block\";this.form.submit();'>" D_START " %s</button></form>"
"<br><input type='file' name='u2'><br>"
"<br><button type='submit' onclick='eb(\"f1\").style.display=\"none\";eb(\"f2\").style.display=\"block\";this.form.submit();'>" D_START " %s</button></form>"
"</fieldset>"
"</div>"
"<div id='f2' name='f2' style='display:none;text-align:center;'><b>" D_UPLOAD_STARTED " ...</b></div>";
"<div id='f2' style='display:none;text-align:center;'><b>" D_UPLOAD_STARTED " ...</b></div>";
const char HTTP_FORM_CMND[] PROGMEM =
"<br/><textarea readonly id='t1' name='t1' cols='340' wrap='off'></textarea><br/><br/>"
"<br><textarea readonly id='t1' cols='340' wrap='off'></textarea><br><br>"
"<form method='get' onsubmit='return l(1);'>"
"<input id='c1' name='c1' placeholder='" D_ENTER_COMMAND "' autofocus><br/>"
// "<br/><button type='submit'>Send command</button>"
"<input id='c1' placeholder='" D_ENTER_COMMAND "' autofocus><br>"
// "<br><button type='submit'>Send command</button>"
"</form>";
const char HTTP_TABLE100[] PROGMEM =
"<table style='width:100%%'>";
const char HTTP_COUNTER[] PROGMEM =
"<br/><div id='t' name='t' style='text-align:center;'></div>";
"<br><div id='t' style='text-align:center;'></div>";
const char HTTP_END[] PROGMEM =
"<div style='text-align:right;font-size:11px;'><hr/><a href='https://bit.ly/tasmota' target='_blank' style='color:#aaa;'>Sonoff-Tasmota %s " D_BY " Theo Arends</a></div>"
@ -809,9 +813,9 @@ void WebRestart(uint8_t type)
WSContentSend_P(HTTP_SCRIPT_RELOAD);
WSContentSendStyle();
if (type) {
WSContentSend_P(PSTR("<div style='text-align:center;'><b>" D_CONFIGURATION_SAVED "</b><br/>"));
WSContentSend_P(PSTR("<div style='text-align:center;'><b>" D_CONFIGURATION_SAVED "</b><br>"));
if (2 == type) {
WSContentSend_P(PSTR("<br/>" D_TRYING_TO_CONNECT "<br/>"));
WSContentSend_P(PSTR("<br>" D_TRYING_TO_CONNECT "<br>"));
}
WSContentSend_P(PSTR("</div>"));
}
@ -1112,8 +1116,8 @@ void HandleTemplateConfiguration(void)
WSContentSendStyle();
WSContentSend_P(HTTP_FORM_TEMPLATE);
WSContentSend_P(HTTP_TABLE100);
WSContentSend_P(PSTR("<tr><td><b>" D_TEMPLATE_NAME "</b></td><td style='width:200px'><input id='s1' name='s1' placeholder='" D_TEMPLATE_NAME "'></td></tr>"
"<tr><td><b>" D_BASE_TYPE "</b></td><td><select id='g99' name='g99' onchange='st(this.value)'></select></td></tr>"
WSContentSend_P(PSTR("<tr><td><b>" D_TEMPLATE_NAME "</b></td><td style='width:200px'><input id='s1' placeholder='" D_TEMPLATE_NAME "'></td></tr>"
"<tr><td><b>" D_BASE_TYPE "</b></td><td><select id='g99' onchange='st(this.value)'></select></td></tr>"
"</table>"
"<hr/>"));
WSContentSend_P(HTTP_TABLE100);
@ -1123,7 +1127,7 @@ void HandleTemplateConfiguration(void)
((9==i)||(10==i)) ? WebColor(COL_TEXT_WARNING) : WebColor(COL_TEXT), i, (0==i) ? " style='width:200px'" : "", i, i);
}
}
WSContentSend_P(PSTR("<tr><td><b><font color='#%06x'>" D_ADC "0</font></b></td><td><select id='g17' name='g17'></select></td></tr>"), WebColor(COL_TEXT));
WSContentSend_P(PSTR("<tr><td><b><font color='#%06x'>" D_ADC "0</font></b></td><td><select id='g17'></select></td></tr>"), WebColor(COL_TEXT));
WSContentSend_P(PSTR("</table>"));
gpio_flag flag = ModuleFlag();
if (flag.data > ADC0_USER) {
@ -1249,7 +1253,7 @@ void HandleModuleConfiguration(void)
}
#ifndef USE_ADC_VCC
if (ValidAdc()) {
WSContentSend_P(PSTR("<tr><td>%s <b>" D_ADC "0</b></td><td style='width:176px'><select id='g17' name='g17'></select></td></tr>"), (WEMOS==my_module_type)?"A0":"");
WSContentSend_P(PSTR("<tr><td>%s <b>" D_ADC "0</b></td><td style='width:176px'><select id='g17'></select></td></tr>"), (WEMOS==my_module_type)?"A0":"");
}
#endif // USE_ADC_VCC
WSContentSend_P(PSTR("</table>"));
@ -1396,10 +1400,10 @@ void HandleWifiConfiguration(void)
}
}
WSContentSend_P(PSTR("<br/>"));
WSContentSend_P(PSTR("<br>"));
}
} else {
WSContentSend_P(PSTR("<div><a href='/wi?scan='>" D_SCAN_FOR_WIFI_NETWORKS "</a></div><br/>"));
WSContentSend_P(PSTR("<div><a href='/wi?scan='>" D_SCAN_FOR_WIFI_NETWORKS "</a></div><br>"));
}
// As WIFI_HOSTNAME may contain %s-%04d it cannot be part of HTTP_FORM_WIFI where it will exception
@ -1460,7 +1464,7 @@ void HandleLoggingConfiguration(void)
uint8_t dlevel[3] = { LOG_LEVEL_INFO, LOG_LEVEL_INFO, LOG_LEVEL_NONE };
for (uint8_t idx = 0; idx < 3; idx++) {
uint8_t llevel = (0==idx)?Settings.seriallog_level:(1==idx)?Settings.weblog_level:Settings.syslog_level;
WSContentSend_P(PSTR("<p><b>%s</b> (%s)<br/><select id='l%d' name='l%d'>"),
WSContentSend_P(PSTR("<p><b>%s</b> (%s)<br><select id='l%d'>"),
GetTextIndexed(stemp1, sizeof(stemp1), idx, kLoggingOptions),
GetTextIndexed(stemp2, sizeof(stemp2), dlevel[idx], kLoggingLevels),
idx, idx);
@ -1528,7 +1532,7 @@ void HandleOtherConfiguration(void)
if (SONOFF_IFAN02 == my_module_type) { maxfn = 1; }
for (uint8_t i = 0; i < maxfn; i++) {
snprintf_P(stemp, sizeof(stemp), PSTR("%d"), i +1);
WSContentSend_P(PSTR("<b>" D_FRIENDLY_NAME " %d</b> (" FRIENDLY_NAME "%s)<br/><input id='a%d' name='a%d' placeholder='" FRIENDLY_NAME "%s' value='%s'><p></p>"),
WSContentSend_P(PSTR("<b>" D_FRIENDLY_NAME " %d</b> (" FRIENDLY_NAME "%s)<br><input id='a%d' name='a%d' placeholder='" FRIENDLY_NAME "%s' value='%s'><p></p>"),
i +1,
(i) ? stemp : "",
i, i,
@ -1537,7 +1541,7 @@ void HandleOtherConfiguration(void)
}
#ifdef USE_EMULATION
WSContentSend_P(PSTR("<p></p><fieldset><legend><b>&nbsp;" D_EMULATION "&nbsp;</b></legend><p>")); // Keep close to Friendlynames so do not use <br/>
WSContentSend_P(PSTR("<p></p><fieldset><legend><b>&nbsp;" D_EMULATION "&nbsp;</b></legend><p>")); // Keep close to Friendlynames so do not use <br>
for (uint8_t i = 0; i < EMUL_MAX; i++) {
#ifndef USE_EMULATION_WEMO
if (i == EMUL_WEMO) { i++; }
@ -1546,7 +1550,7 @@ void HandleOtherConfiguration(void)
if (i == EMUL_HUE) { i++; }
#endif
if (i < EMUL_MAX) {
WSContentSend_P(PSTR("<input id='r%d' name='b2' type='radio' value='%d'%s><b>%s</b> %s<br/>"), // Different id only used for labels
WSContentSend_P(PSTR("<input id='r%d' name='b2' type='radio' value='%d'%s><b>%s</b> %s<br>"), // Different id only used for labels
i, i,
(i == Settings.flag2.emulation) ? " checked" : "",
GetTextIndexed(stemp, sizeof(stemp), i, kEmulationOptions),
@ -1844,8 +1848,8 @@ void HandleUploadDone(void)
WSContentSendStyle();
WSContentSend_P(PSTR("<div style='text-align:center;'><b>" D_UPLOAD " <font color='#"));
if (upload_error) {
// WSContentSend_P(PSTR(COLOR_TEXT_WARNING "'>" D_FAILED "</font></b><br/><br/>"));
WSContentSend_P(PSTR("%06x'>" D_FAILED "</font></b><br/><br/>"), WebColor(COL_TEXT_WARNING));
// WSContentSend_P(PSTR(COLOR_TEXT_WARNING "'>" D_FAILED "</font></b><br><br>"));
WSContentSend_P(PSTR("%06x'>" D_FAILED "</font></b><br><br>"), WebColor(COL_TEXT_WARNING));
#ifdef USE_RF_FLASH
if (upload_error < 14) {
#else
@ -1859,13 +1863,13 @@ void HandleUploadDone(void)
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_UPLOAD ": %s"), error);
stop_flash_rotate = Settings.flag.stop_flash_rotate;
} else {
WSContentSend_P(PSTR("%06x'>" D_SUCCESSFUL "</font></b><br/>"), WebColor(COL_TEXT_SUCCESS));
WSContentSend_P(PSTR("%06x'>" D_SUCCESSFUL "</font></b><br>"), WebColor(COL_TEXT_SUCCESS));
WSContentSend_P(HTTP_MSG_RSTRT);
ShowWebSource(SRC_WEBGUI);
restart_flag = 2; // Always restart to re-enable disabled features during update
}
SettingsBufferFree();
WSContentSend_P(PSTR("</div><br/>"));
WSContentSend_P(PSTR("</div><br>"));
WSContentSpaceButton(BUTTON_MAIN);
WSContentStop();
}

View File

@ -746,14 +746,14 @@ const char HTTP_BTN_MENU_MQTT[] PROGMEM =
const char HTTP_FORM_MQTT1[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_MQTT_PARAMETERS "&nbsp;</b></legend>"
"<form method='get' action='" WEB_HANDLE_MQTT "'>"
"<p><b>" D_HOST "</b> (" MQTT_HOST ")<br/><input id='mh' name='mh' placeholder='" MQTT_HOST" ' value='%s'></p>"
"<p><b>" D_PORT "</b> (" STR(MQTT_PORT) ")<br/><input id='ml' name='ml' placeholder='" STR(MQTT_PORT) "' value='%d'></p>"
"<p><b>" D_CLIENT "</b> (%s)<br/><input id='mc' name='mc' placeholder='%s' value='%s'></p>";
"<p><b>" D_HOST "</b> (" MQTT_HOST ")<br><input id='mh' placeholder='" MQTT_HOST" ' value='%s'></p>"
"<p><b>" D_PORT "</b> (" STR(MQTT_PORT) ")<br><input id='ml' placeholder='" STR(MQTT_PORT) "' value='%d'></p>"
"<p><b>" D_CLIENT "</b> (%s)<br><input id='mc' placeholder='%s' value='%s'></p>";
const char HTTP_FORM_MQTT2[] PROGMEM =
"<p><b>" D_USER "</b> (" MQTT_USER ")<br/><input id='mu' name='mu' placeholder='" MQTT_USER "' value='%s'></p>"
"<p><b>" D_PASSWORD "</b><br/><input id='mp' name='mp' type='password' placeholder='" D_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_TOPIC "</b> = %%topic%% (%s)<br/><input id='mt' name='mt' placeholder='%s' value='%s'></p>"
"<p><b>" D_FULL_TOPIC "</b> (%s)<br/><input id='mf' name='mf' placeholder='%s' value='%s'></p>";
"<p><b>" D_USER "</b> (" MQTT_USER ")<br><input id='mu' placeholder='" MQTT_USER "' value='%s'></p>"
"<p><b>" D_PASSWORD "</b><br><input id='mp' type='password' placeholder='" D_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
"<p><b>" D_TOPIC "</b> = %%topic%% (%s)<br><input id='mt' placeholder='%s' value='%s'></p>"
"<p><b>" D_FULL_TOPIC "</b> (%s)<br><input id='mf' placeholder='%s' value='%s'></p>";
void HandleMqttConfiguration(void)
{

View File

@ -660,37 +660,37 @@ const char HTTP_FORM_TIMER1[] PROGMEM =
"<fieldset style='min-width:470px;text-align:center;'>"
"<legend style='text-align:left;'><b>&nbsp;" D_TIMER_PARAMETERS "&nbsp;</b></legend>"
"<form method='post' action='" WEB_HANDLE_TIMER "' onsubmit='return st();'>"
"<br/><input id='e0' name='e0' type='checkbox'%s><b>" D_TIMER_ENABLE "</b><br/><br/><hr/>"
"<input id='t0' name='t0' value='";
"<br><input id='e0' type='checkbox'%s><b>" D_TIMER_ENABLE "</b><br><br><hr/>"
"<input id='t0' value='";
const char HTTP_FORM_TIMER2[] PROGMEM =
"' hidden><div id='bt' name='bt'></div><br/><br/><br/>"
"<div id='oa' name='oa'></div><br/>"
"' hidden><div id='bt'></div><br><br><br>"
"<div id='oa'></div><br>"
"<div>"
"<input id='a0' name='a0' type='checkbox'><b>" D_TIMER_ARM "</b>&emsp;"
"<input id='r0' name='r0' type='checkbox'><b>" D_TIMER_REPEAT "</b>"
"</div><br/>"
"<input id='a0' type='checkbox'><b>" D_TIMER_ARM "</b>&emsp;"
"<input id='r0' type='checkbox'><b>" D_TIMER_REPEAT "</b>"
"</div><br>"
"<div>";
#ifdef USE_SUNRISE
const char HTTP_FORM_TIMER3[] PROGMEM =
"<fieldset style='width:%dpx;margin:auto;text-align:left;border:0;'>"
"<input id='b0' name='rd' type='radio' value='0' onclick='gt();'><b>" D_TIMER_TIME "</b><br/>"
"<input id='b1' name='rd' type='radio' value='1' onclick='gt();'><b>" D_SUNRISE "</b> (%s)<br/>"
"<input id='b2' name='rd' type='radio' value='2' onclick='gt();'><b>" D_SUNSET "</b> (%s)<br/>"
"<input id='b0' name='rd' type='radio' value='0' onclick='gt();'><b>" D_TIMER_TIME "</b><br>"
"<input id='b1' name='rd' type='radio' value='1' onclick='gt();'><b>" D_SUNRISE "</b> (%s)<br>"
"<input id='b2' name='rd' type='radio' value='2' onclick='gt();'><b>" D_SUNSET "</b> (%s)<br>"
"</fieldset>"
"<p></p>"
"<span><select style='width:46px;' id='dr' name='dr'></select></span>"
"<span><select style='width:46px;' id='dr'></select></span>"
"&nbsp;";
#else
const char HTTP_FORM_TIMER3[] PROGMEM =
"<b>" D_TIMER_TIME "</b>&nbsp;";
#endif // USE_SUNRISE
const char HTTP_FORM_TIMER4[] PROGMEM =
"<span><select style='width:60px;' id='ho' name='ho'></select></span>"
"<span><select style='width:60px;' id='ho'></select></span>"
"&nbsp;" D_HOUR_MINUTE_SEPARATOR "&nbsp;"
"<span><select style='width:60px;' id='mi' name='mi'></select></span>"
"<span><select style='width:60px;' id='mi'></select></span>"
"&emsp;<b>+/-</b>&nbsp;"
"<span><select style='width:60px;' id='mw' name='mw'></select></span>"
"</div><br/>"
"<span><select style='width:60px;' id='mw'></select></span>"
"</div><br>"
"<div id='ds' name='ds'></div>";
void HandleTimerConfiguration(void)

View File

@ -2387,8 +2387,8 @@ const char HTTP_FORM_SCRIPT[] PROGMEM =
const char HTTP_FORM_SCRIPT1[] PROGMEM =
"<div style='text-align:right' id='charNum'> </div>"
"<input style='width:3%%;' id='c%d' name='c%d' type='checkbox'%s><b>script enable</b><br/>"
"<br><textarea id='t1' name='t1' rows='8' cols='80' maxlength='%d' style='font-size: 12pt' >";
"<input style='width:3%%;' id='c%d' name='c%d' type='checkbox'%s><b>script enable</b><br>"
"<br><textarea id='t1' rows='8' cols='80' maxlength='%d' style='font-size: 12pt' >";
const char HTTP_FORM_SCRIPT1b[] PROGMEM =

View File

@ -745,19 +745,19 @@ const char HTTP_FORM_KNX[] PROGMEM =
"<fieldset style='min-width:530px;'>"
"<legend style='text-align:left;'><b>&nbsp;" D_KNX_PARAMETERS "&nbsp;</b></legend>"
"<form method='post' action='kn'>"
"<br/><center>"
"<br><center>"
"<b>" D_KNX_PHYSICAL_ADDRESS " </b>"
"<input style='width:12%%;' type='number' name='area' min='0' max='15' value='%d'> . "
"<input style='width:12%%;' type='number' name='line' min='0' max='15' value='%d'> . "
"<input style='width:12%%;' type='number' name='member' min='0' max='255' value='%d'>"
"<br/><br/>" D_KNX_PHYSICAL_ADDRESS_NOTE "<br/><br/>"
"<input id='b1' name='b1' type='checkbox'";
"<br><br>" D_KNX_PHYSICAL_ADDRESS_NOTE "<br><br>"
"<input id='b1' type='checkbox'";
const char HTTP_FORM_KNX1[] PROGMEM =
"><b>" D_KNX_ENABLE "</b>&emsp;<input id='b2' name='b2' type='checkbox'";
"><b>" D_KNX_ENABLE "</b>&emsp;<input id='b2' type='checkbox'";
const char HTTP_FORM_KNX2[] PROGMEM =
"><b>" D_KNX_ENHANCEMENT "</b><br/></center><br/>"
"><b>" D_KNX_ENHANCEMENT "</b><br></center><br>"
"<fieldset><center>"
"<b>" D_KNX_GROUP_ADDRESS_TO_WRITE "</b><hr>"
@ -773,7 +773,7 @@ const char HTTP_FORM_KNX_GA[] PROGMEM =
"<input style='width:12%%;' type='number' id='%s' name='%s' min='0' max='255' value='0'> ";
const char HTTP_FORM_KNX_ADD_BTN[] PROGMEM =
"<button type='submit' onclick='%s()' %s name='btn_add' value='%d' style='width:18%%;'>" D_ADD "</button><br/><br/>"
"<button type='submit' onclick='%s()' %s name='btn_add' value='%d' style='width:18%%;'>" D_ADD "</button><br><br>"
"<table style='width:80%%; font-size: 14px;'><col width='250'><col width='30'>";
const char HTTP_FORM_KNX_ADD_TABLE_ROW[] PROGMEM =
@ -781,7 +781,7 @@ const char HTTP_FORM_KNX_ADD_TABLE_ROW[] PROGMEM =
"<td><button type='submit' name='btn_del_ga' value='%d' class='button bred'> " D_DELETE " </button></td></tr>";
const char HTTP_FORM_KNX3[] PROGMEM =
"</table></center></fieldset><br/>"
"</table></center></fieldset><br>"
"<fieldset><form method='post' action='kn'><center>"
"<b>" D_KNX_GROUP_ADDRESS_TO_READ "</b><hr>";

View File

@ -411,14 +411,14 @@ const char HTTP_BTN_MENU_HX711[] PROGMEM =
const char HTTP_FORM_HX711[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_CALIBRATION "&nbsp;</b></legend>"
"<form method='post' action='" WEB_HANDLE_HX711 "'>"
"<p><b>" D_REFERENCE_WEIGHT "</b> (" D_UNIT_KILOGRAM ")<br/><input type='number' step='0.001' id='p1' name='p1' placeholder='0' value='%s'></p>"
"<br/><button name='calibrate' type='submit'>" D_CALIBRATE "</button>"
"<p><b>" D_REFERENCE_WEIGHT "</b> (" D_UNIT_KILOGRAM ")<br><input type='number' step='0.001' id='p1' placeholder='0' value='%s'></p>"
"<br><button name='calibrate' type='submit'>" D_CALIBRATE "</button>"
"</form>"
"</fieldset><br/><br/>"
"</fieldset><br><br>"
"<fieldset><legend><b>&nbsp;" D_HX711_PARAMETERS "&nbsp;</b></legend>"
"<form method='post' action='" WEB_HANDLE_HX711 "'>"
"<p><b>" D_ITEM_WEIGHT "</b> (" D_UNIT_KILOGRAM ")<br/><input type='number' max='6.5535' step='0.0001' id='p2' name='p2' placeholder='0.0' value='%s'></p>";
"<p><b>" D_ITEM_WEIGHT "</b> (" D_UNIT_KILOGRAM ")<br><input type='number' max='6.5535' step='0.0001' id='p2' placeholder='0.0' value='%s'></p>";
void HandleHxAction(void)
{

View File

@ -1566,7 +1566,7 @@ def PushTasmotaConfig(encode_cfg, host, port, username=DEFAULTS['source']['usern
body = body[findUpload:]
findSuccessful = body.find("Successful")
if findSuccessful < 0:
errmatch = re.search("<font\s*color='[#0-9a-fA-F]+'>(\S*)</font></b><br/><br/>(.*)<br/>", body)
errmatch = re.search("<font\s*color='[#0-9a-fA-F]+'>(\S*)</font></b><br><br>(.*)<br>", body)
reason = "Unknown error"
if errmatch and len(errmatch.groups()) > 1:
reason = errmatch.group(2)