Skip to content

Commit

Permalink
Bump version to v1.4.4
Browse files Browse the repository at this point in the history
* update webserver
  • Loading branch information
hung-eoh committed Nov 22, 2024
1 parent fdca835 commit 6c01e50
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ERa",
"version": "1.4.3",
"version": "1.4.4",
"description": "E-Ra by EoH. An IoT Market Enabler! It supports WiFi, Ethernet, Zigbee, Modbus, Serial. Works with boards like Arduino, ESP8266, ESP32, STM32, Raspberry Pi...",
"keywords": "ERa, E-Ra, esp8266, esp32, stm32, raspberry-pi, http, mqtt, zigbee, modbus, sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, wifi, ethernet, serial",
"authors":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ERa
version=1.4.3
version=1.4.4
author=EoH Ltd
license=MIT
maintainer=EoH Ltd <info@eoh.io>
Expand Down
6 changes: 3 additions & 3 deletions linux/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

ERA_MAJOR = 1
ERA_MINOR = 4
ERA_PATCH = 3
ERA_VERSION = "1.4.3"
ERA_FIRMWARE_VERSION = "1.4.3"
ERA_PATCH = 4
ERA_VERSION = "1.4.4"
ERA_FIRMWARE_VERSION = "1.4.4"

BUTTON_GPIO = 16

Expand Down
4 changes: 2 additions & 2 deletions src/ERa/ERaVersion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define ERA_MAJOR 1
#define ERA_MINOR 4
#define ERA_PATCH 3
#define ERA_PATCH 4

#define ERA_VERSION_TO_STR_2(val) # val
#define ERA_VERSION_TO_STR(val) ERA_VERSION_TO_STR_2(val)
Expand All @@ -17,7 +17,7 @@
#define ERA_VERSION ERA_VERSION_TO_STR(ERA_MAJOR) "." \
ERA_VERSION_TO_STR(ERA_MINOR) "." \
ERA_VERSION_TO_STR(ERA_PATCH)
#define ERA_VERSION_1_4_3
#define ERA_VERSION_1_4_4

#if !defined(ERA_FIRMWARE_VERSION)
#define ERA_FIRMWARE_VERSION ERA_VERSION
Expand Down
7 changes: 5 additions & 2 deletions src/PnP/ERaPnPEsp32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ void ERaPnP<Transport>::configApi() {
content += ERA_F("</select>");
}
else {
content += ERA_F("<input name=ssid id=ssid placeholder='%SSID%'>");
content += ERA_F("<input name=ssid id=ssid placeholder='%SSID% (*)'>");
}
content += ERA_F("<input name=pass id=pass placeholder='%PASSWORD%' type=password>");

Expand Down Expand Up @@ -826,13 +826,16 @@ void ERaPnP<Transport>::configApi() {
content += ERA_F("<input name=backup_ssid id=backup_ssid placeholder='%BACKUP_SSID%'>");
}
content += ERA_F("<input name=backup_pass id=backup_pass placeholder='%BACKUP_PASS%' type=password>");

/* MQTT Config */
content += ERA_F("<hr><h1>MQTT</h1>");
content += ERA_F("<input name=host id=host value='");
content += ERaConfig.host;
content += ERA_F("'>");
content += ERA_F("<input name=port id=port value='");
content += String(ERaConfig.port);
content += ERA_F("'>");
content += ERA_F("<input name=token id=token placeholder='%TOKEN%'>");
content += ERA_F("<input name=token id=token placeholder='%TOKEN% (*)'>");
content += ERA_F("<input name=username id=username placeholder='%USERNAME%'>");
content += ERA_F("<input name=password id=password placeholder='%PASSWORD%' type=password>");
content += ERA_F("<input type=checkbox onclick=togglePass() class=checkbox> %SHOW_PASSWORD%");
Expand Down
7 changes: 5 additions & 2 deletions src/PnP/ERaPnPEsp8266.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ void ERaPnP<Transport>::configApi() {
content += ERA_F("</select>");
}
else {
content += ERA_F("<input name=ssid id=ssid placeholder='%SSID%'>");
content += ERA_F("<input name=ssid id=ssid placeholder='%SSID% (*)'>");
}
content += ERA_F("<input name=pass id=pass placeholder='%PASSWORD%' type=password>");

Expand Down Expand Up @@ -724,13 +724,16 @@ void ERaPnP<Transport>::configApi() {
content += ERA_F("<input name=backup_ssid id=backup_ssid placeholder='%BACKUP_SSID%'>");
}
content += ERA_F("<input name=backup_pass id=backup_pass placeholder='%BACKUP_PASS%' type=password>");

/* MQTT Config */
content += ERA_F("<hr><h1>MQTT</h1>");
content += ERA_F("<input name=host id=host value='");
content += ERaConfig.host;
content += ERA_F("'>");
content += ERA_F("<input name=port id=port value='");
content += String(ERaConfig.port);
content += ERA_F("'>");
content += ERA_F("<input name=token id=token placeholder='%TOKEN%'>");
content += ERA_F("<input name=token id=token placeholder='%TOKEN% (*)'>");
content += ERA_F("<input name=username id=username placeholder='%USERNAME%'>");
content += ERA_F("<input name=password id=password placeholder='%PASSWORD%' type=password>");
content += ERA_F("<input type=checkbox onclick=togglePass() class=checkbox> %SHOW_PASSWORD%");
Expand Down
9 changes: 9 additions & 0 deletions src/PnP/ERaWeb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ static const char webScript[] ERA_PROGMEM =
"x.type = 'password'; }}"
"function clicked(e) {"
"var id = document.getElementById('ssid');"
"var pass = document.getElementById('pass');"
"var auth = document.getElementById('token');"
"let selected = undefined;"
"if (id?.tagName === 'SELECT') {"
"selected = id?.options[id.selectedIndex]; }"
"if (id.value === '') {"
"alert('%NONE_WIFI_MSG%');"
"e.preventDefault();"
"} else if (selected?.text.includes('*') && pass.value === '') {"
"alert('%NONE_PASS_MSG%');"
"e.preventDefault();"
"} else if (auth.value === '') {"
"alert('%NONE_AUTH_MSG%');"
"e.preventDefault();"
Expand Down Expand Up @@ -296,6 +303,7 @@ enum LanguageWebT {
#define LANGUAGE_SAVE_MSG(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Do you want force save?" : "Bạn có muốn lưu?"
#define LANGUAGE_WIFI_MSG(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Do you want connect to" : "Bạn có muốn kết nối"
#define LANGUAGE_NONE_WIFI_MSG(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Please choose WiFi!" : "Vui lòng chọn WiFi!"
#define LANGUAGE_NONE_PASS_MSG(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Please enter the password!" : "Vui lòng nhập mật khẩu!"
#define LANGUAGE_NONE_AUTH_MSG(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Please provide the token!" : "Vui lòng cung cấp mã token!"
#define LANGUAGE_ONLINE(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Online" : "Trực tuyến"
#define LANGUAGE_OFFLINE(lang) (lang == LanguageWebT::LANGUAGE_EN) ? "Offline" : "Ngoại tuyến"
Expand Down Expand Up @@ -344,6 +352,7 @@ static void WebProcessor(String& str, uint8_t language = LANGUAGE_EN) {
str.replace("%SAVE_MSG%", LANGUAGE_SAVE_MSG(language));
str.replace("%WIFI_MSG%", LANGUAGE_WIFI_MSG(language));
str.replace("%NONE_WIFI_MSG%", LANGUAGE_NONE_WIFI_MSG(language));
str.replace("%NONE_PASS_MSG%", LANGUAGE_NONE_PASS_MSG(language));
str.replace("%NONE_AUTH_MSG%", LANGUAGE_NONE_AUTH_MSG(language));
str.replace("%RESET_NETWORK_MSG%", LANGUAGE_RESET_NETWORK_MSG(language));
str.replace("%HOST%", LANGUAGE_HOST(language));
Expand Down

0 comments on commit 6c01e50

Please sign in to comment.