mirror of https://github.com/arendst/Tasmota.git
Redesigned GUI
Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles``
This commit is contained in:
parent
82c7ac37e0
commit
f7b45ffddb
|
@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
|||
- In tasmota-sensors.bin enabled support for VL53L0X and disabled TSL2561 (#11711)
|
||||
- Add HLW8012/BL0937 average pulse calculation by Alex Lovett (#11722)
|
||||
- Redesigned initial GUI wifi configuration by Adrian Scillato (#11693)
|
||||
- Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles``
|
||||
|
||||
### Fixed
|
||||
- Telegram chat id incorrect size (#11660)
|
||||
|
|
|
@ -120,6 +120,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
|
|||
- ADC range result from int to float using command ``FreqRes`` for decimal resolution selection [#11545](https://github.com/arendst/Tasmota/issues/11545)
|
||||
- Removed overtemp detection on external energy monitoring devices [#11628](https://github.com/arendst/Tasmota/issues/11628)
|
||||
- Redesigned initial GUI wifi configuration by Adrian Scillato [#11693](https://github.com/arendst/Tasmota/issues/11693)
|
||||
- Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles``
|
||||
- In tasmota-sensors.bin enabled support for VL53L0X and disabled TSL2561 [#11711](https://github.com/arendst/Tasmota/issues/11711)
|
||||
- Add HLW8012/BL0937 average pulse calculation by Alex Lovett [#11722](https://github.com/arendst/Tasmota/issues/11722)
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ enum XsnsFunctions {FUNC_SETTINGS_OVERRIDE, FUNC_PIN_STATE, FUNC_MODULE_INIT, FU
|
|||
FUNC_SET_POWER, FUNC_SET_DEVICE_POWER, FUNC_SHOW_SENSOR, FUNC_ANY_KEY,
|
||||
FUNC_ENERGY_EVERY_SECOND, FUNC_ENERGY_RESET,
|
||||
FUNC_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM, FUNC_BUTTON_PRESSED,
|
||||
FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_MANAGEMENT_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON,
|
||||
FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_CONSOLE_BUTTON, FUNC_WEB_ADD_MANAGEMENT_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON,
|
||||
FUNC_WEB_ADD_HANDLER, FUNC_SET_CHANNELS, FUNC_SET_SCHEME, FUNC_HOTPLUG_SCAN,
|
||||
FUNC_DEVICE_GROUP_ITEM };
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
#define USE_SCRIPT_GLOBVARS
|
||||
#define USE_SCRIPT_SUB_COMMAND
|
||||
#define USE_ANGLE_FUNC
|
||||
#define USE_SCRIPT_WEB_DISPLAY
|
||||
#define SCRIPT_FULL_WEBPAGE
|
||||
#define SCRIPT_GET_HTTPS_JP
|
||||
#define USE_GOOGLE_CHARTS
|
||||
|
|
|
@ -361,16 +361,19 @@ const char HTTP_DEVICE_STATE[] PROGMEM = "<td style='width:%d%%;text-align:cente
|
|||
|
||||
enum ButtonTitle {
|
||||
BUTTON_RESTART, BUTTON_RESET_CONFIGURATION,
|
||||
BUTTON_MAIN, BUTTON_CONFIGURATION, BUTTON_INFORMATION, BUTTON_FIRMWARE_UPGRADE, BUTTON_CONSOLE,
|
||||
BUTTON_MODULE, BUTTON_WIFI, BUTTON_LOGGING, BUTTON_OTHER, BUTTON_TEMPLATE, BUTTON_BACKUP, BUTTON_RESTORE };
|
||||
BUTTON_MAIN, BUTTON_CONFIGURATION, BUTTON_INFORMATION, BUTTON_FIRMWARE_UPGRADE, BUTTON_MANAGEMENT,
|
||||
BUTTON_MODULE, BUTTON_WIFI, BUTTON_LOGGING, BUTTON_OTHER, BUTTON_TEMPLATE, BUTTON_BACKUP, BUTTON_RESTORE,
|
||||
BUTTON_CONSOLE };
|
||||
const char kButtonTitle[] PROGMEM =
|
||||
D_RESTART "|" D_RESET_CONFIGURATION "|"
|
||||
D_MAIN_MENU "|" D_CONFIGURATION "|" D_INFORMATION "|" D_FIRMWARE_UPGRADE "|" D_CONSOLE "|"
|
||||
D_CONFIGURE_MODULE "|" D_CONFIGURE_WIFI"|" D_CONFIGURE_LOGGING "|" D_CONFIGURE_OTHER "|" D_CONFIGURE_TEMPLATE "|" D_BACKUP_CONFIGURATION "|" D_RESTORE_CONFIGURATION;
|
||||
D_MAIN_MENU "|" D_CONFIGURATION "|" D_INFORMATION "|" D_FIRMWARE_UPGRADE "|" D_MANAGEMENT "|"
|
||||
D_CONFIGURE_MODULE "|" D_CONFIGURE_WIFI"|" D_CONFIGURE_LOGGING "|" D_CONFIGURE_OTHER "|" D_CONFIGURE_TEMPLATE "|" D_BACKUP_CONFIGURATION "|" D_RESTORE_CONFIGURATION "|"
|
||||
D_CONSOLE;
|
||||
const char kButtonAction[] PROGMEM =
|
||||
".|rt|"
|
||||
".|cn|in|up|cs|"
|
||||
"md|wi|lg|co|tp|dl|rs";
|
||||
".|cn|in|up|mn|"
|
||||
"md|wi|lg|co|tp|dl|rs|"
|
||||
"cs";
|
||||
const char kButtonConfirm[] PROGMEM = D_CONFIRM_RESTART "|" D_CONFIRM_RESET_CONFIGURATION;
|
||||
|
||||
enum CTypes { CT_HTML, CT_PLAIN, CT_XML, CT_STREAM, CT_APP_JSON, CT_APP_STREAM };
|
||||
|
@ -452,6 +455,7 @@ const WebServerDispatch_t WebServerDispatch[] PROGMEM = {
|
|||
{ "u1", HTTP_ANY, HandleUpgradeFirmwareStart }, // OTA
|
||||
{ "u2", HTTP_OPTIONS, HandlePreflightRequest },
|
||||
{ "u3", HTTP_ANY, HandleUploadDone },
|
||||
{ "mn", HTTP_GET, HandleManagement },
|
||||
{ "cs", HTTP_GET, HandleConsole },
|
||||
{ "cs", HTTP_OPTIONS, HandlePreflightRequest },
|
||||
{ "cm", HTTP_ANY, HandleHttpCommand },
|
||||
|
@ -952,6 +956,19 @@ void HandleWifiLogin(void)
|
|||
WSContentStop();
|
||||
}
|
||||
|
||||
uint32_t WebUseManagementSubmenu(void) {
|
||||
static uint32_t management_count = 0;
|
||||
|
||||
if (!management_count) {
|
||||
XdrvMailbox.index = 1;
|
||||
XdrvCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XsnsCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
management_count = XdrvMailbox.index;
|
||||
}
|
||||
return management_count -1;
|
||||
}
|
||||
|
||||
uint32_t WebDeviceColumns(void) {
|
||||
const uint32_t max_columns = 8;
|
||||
|
||||
|
@ -1185,12 +1202,17 @@ void HandleRoot(void)
|
|||
if (HTTP_ADMIN == Web.state) {
|
||||
#ifdef FIRMWARE_MINIMAL
|
||||
WSContentSpaceButton(BUTTON_FIRMWARE_UPGRADE);
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
#else
|
||||
WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||
WSContentButton(BUTTON_INFORMATION);
|
||||
WSContentButton(BUTTON_FIRMWARE_UPGRADE);
|
||||
if (!WebUseManagementSubmenu()) {
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
} else {
|
||||
WSContentButton(BUTTON_MANAGEMENT);
|
||||
}
|
||||
#endif // Not FIRMWARE_MINIMAL
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
WSContentButton(BUTTON_RESTART);
|
||||
}
|
||||
WSContentStop();
|
||||
|
@ -1412,9 +1434,6 @@ void HandleConfiguration(void)
|
|||
WSContentButton(BUTTON_BACKUP);
|
||||
WSContentButton(BUTTON_RESTORE);
|
||||
|
||||
WSContentSend_P(PSTR("<div></div>")); // 5px padding
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
|
@ -2888,6 +2907,28 @@ void HandleHttpCommand(void)
|
|||
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
void HandleManagement(void)
|
||||
{
|
||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP D_MANAGEMENT));
|
||||
|
||||
WSContentStart_P(PSTR(D_MANAGEMENT));
|
||||
WSContentSendStyle();
|
||||
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
|
||||
XdrvMailbox.index = 0;
|
||||
XdrvCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XsnsCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
|
||||
WSContentSend_P(PSTR("<div></div>")); // 5px padding
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
void HandleConsole(void)
|
||||
{
|
||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||
|
@ -2903,7 +2944,7 @@ void HandleConsole(void)
|
|||
WSContentSend_P(HTTP_SCRIPT_CONSOL, Settings.web_refresh);
|
||||
WSContentSendStyle();
|
||||
WSContentSend_P(HTTP_FORM_CMND);
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentSpaceButton((WebUseManagementSubmenu()) ? BUTTON_MANAGEMENT : BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
|
|
|
@ -5249,7 +5249,7 @@ void HandleScriptConfiguration(void) {
|
|||
#endif //USE_SCRIPT_FATFS
|
||||
|
||||
WSContentSend_P(HTTP_SCRIPT_FORM_END);
|
||||
WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
|
@ -7897,8 +7897,12 @@ bool Xdrv10(uint8_t function)
|
|||
}
|
||||
break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_ADD_BUTTON:
|
||||
WSContentSend_P(HTTP_BTN_MENU_RULES);
|
||||
case FUNC_WEB_ADD_CONSOLE_BUTTON:
|
||||
if (XdrvMailbox.index) {
|
||||
XdrvMailbox.index++;
|
||||
} else {
|
||||
WSContentSend_P(HTTP_BTN_MENU_RULES);
|
||||
}
|
||||
break;
|
||||
#ifdef USE_SCRIPT_WEB_DISPLAY
|
||||
case FUNC_WEB_ADD_MAIN_BUTTON:
|
||||
|
|
|
@ -661,7 +661,7 @@ void UfsDirectory(void) {
|
|||
}
|
||||
WSContentSend_P(UFS_FORM_SDC_DIRc);
|
||||
WSContentSend_P(UFS_FORM_FILE_UPGb);
|
||||
WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
||||
WSContentStop();
|
||||
|
||||
Web.upload_file_type = UPL_UFSFILE;
|
||||
|
@ -1045,7 +1045,11 @@ bool Xdrv50(uint8_t function) {
|
|||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_ADD_MANAGEMENT_BUTTON:
|
||||
if (ufs_type) {
|
||||
WSContentSend_PD(UFS_WEB_DIR, PSTR(D_MANAGE_FILE_SYSTEM));
|
||||
if (XdrvMailbox.index) {
|
||||
XdrvMailbox.index++;
|
||||
} else {
|
||||
WSContentSend_PD(UFS_WEB_DIR, PSTR(D_MANAGE_FILE_SYSTEM));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FUNC_WEB_ADD_HANDLER:
|
||||
|
|
|
@ -636,7 +636,7 @@ void HandleBerryConsole(void)
|
|||
WSContentFlush();
|
||||
_WSContentSend(HTTP_BERRY_STYLE_CMND);
|
||||
_WSContentSend(HTTP_BERRY_FORM_CMND);
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
|
@ -721,9 +721,13 @@ bool Xdrv52(uint8_t function)
|
|||
// case FUNC_SET_POWER:
|
||||
// break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_ADD_BUTTON:
|
||||
WSContentSend_P(HTTP_BTN_BERRY_CONSOLE);
|
||||
callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr);
|
||||
case FUNC_WEB_ADD_CONSOLE_BUTTON:
|
||||
if (XdrvMailbox.index) {
|
||||
XdrvMailbox.index++;
|
||||
} else {
|
||||
WSContentSend_P(HTTP_BTN_BERRY_CONSOLE);
|
||||
callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr);
|
||||
}
|
||||
break;
|
||||
case FUNC_WEB_ADD_MAIN_BUTTON:
|
||||
callBerryEventDispatcher(PSTR("web_add_main_button"), nullptr, 0, nullptr);
|
||||
|
|
Loading…
Reference in New Issue