|
|
@ -1366,35 +1366,52 @@ String AutoConnect::_token_CURRENT_SSID(PageArgument& args) { |
|
|
|
* @return HTML string of a li tag with the menu item. |
|
|
|
* @return HTML string of a li tag with the menu item. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
String AutoConnect::_attachMenuItem(const AC_MENUITEM_t item) { |
|
|
|
String AutoConnect::_attachMenuItem(const AC_MENUITEM_t item) { |
|
|
|
AC_MENUITEM_t liItem = static_cast<AC_MENUITEM_t>(_apConfig.attachMenu & static_cast<uint16_t>(item)); |
|
|
|
static const char _liTempl[] PROGMEM = "<li class=\"lb-item\"%s><a href=\"%s\">%s</a></li>"; |
|
|
|
String li = String(F("<li class=\"lb-item\"")); |
|
|
|
PGM_P id; |
|
|
|
if (liItem == AC_MENUITEM_RESET) |
|
|
|
PGM_P link; |
|
|
|
li += String(F(" id=\"reset\"><a href=\"#rdlg\">" AUTOCONNECT_MENULABEL_RESET)); |
|
|
|
PGM_P label; |
|
|
|
else { |
|
|
|
|
|
|
|
li += String(F("><a href=\"")); |
|
|
|
switch (static_cast<AC_MENUITEM_t>(_apConfig.attachMenu & static_cast<uint16_t>(item))) { |
|
|
|
switch (liItem) { |
|
|
|
case AC_MENUITEM_CONFIGNEW: |
|
|
|
case AC_MENUITEM_CONFIGNEW: |
|
|
|
id = PSTR(""); |
|
|
|
li += String(F(AUTOCONNECT_URI_CONFIG "\">" AUTOCONNECT_MENULABEL_CONFIGNEW)); |
|
|
|
link = PSTR(AUTOCONNECT_URI_CONFIG); |
|
|
|
break; |
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_CONFIGNEW); |
|
|
|
case AC_MENUITEM_OPENSSIDS: |
|
|
|
break; |
|
|
|
li += String(F(AUTOCONNECT_URI_OPEN "\">" AUTOCONNECT_MENULABEL_OPENSSIDS)); |
|
|
|
case AC_MENUITEM_OPENSSIDS: |
|
|
|
break; |
|
|
|
id = PSTR(""); |
|
|
|
case AC_MENUITEM_DISCONNECT: |
|
|
|
link = PSTR(AUTOCONNECT_URI_OPEN); |
|
|
|
li += String(F(AUTOCONNECT_URI_DISCON "\">" AUTOCONNECT_MENULABEL_DISCONNECT)); |
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_OPENSSIDS); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case AC_MENUITEM_DEVINFO: |
|
|
|
case AC_MENUITEM_DISCONNECT: |
|
|
|
li += String(F(AUTOCONNECT_URI "\">" AUTOCONNECT_MENULABEL_DEVICEINFO)); |
|
|
|
id = PSTR(""); |
|
|
|
break; |
|
|
|
link = PSTR(AUTOCONNECT_URI_DISCON); |
|
|
|
case AC_MENUITEM_HOME: |
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_DISCONNECT); |
|
|
|
li += String(F("HOME_URI\">" AUTOCONNECT_MENULABEL_HOME)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case AC_MENUITEM_RESET: |
|
|
|
default: |
|
|
|
id = PSTR(" id=\"reset\""); |
|
|
|
li = _emptyString; |
|
|
|
link = PSTR("#rdlg"); |
|
|
|
break; |
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_RESET); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case AC_MENUITEM_HOME: |
|
|
|
|
|
|
|
id = PSTR(""); |
|
|
|
|
|
|
|
link = PSTR("HOME_URI"); |
|
|
|
|
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_HOME); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case AC_MENUITEM_DEVINFO: |
|
|
|
|
|
|
|
id = PSTR(""); |
|
|
|
|
|
|
|
link = PSTR(AUTOCONNECT_URI); |
|
|
|
|
|
|
|
label = PSTR(AUTOCONNECT_MENULABEL_DEVINFO); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
id = nullptr; |
|
|
|
|
|
|
|
link = nullptr; |
|
|
|
|
|
|
|
label = nullptr; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
li += String(F("</a></li>")); |
|
|
|
char li[128] = { '\0' }; |
|
|
|
return li; |
|
|
|
if (!!id && !!link && !!label) |
|
|
|
|
|
|
|
snprintf(li, sizeof(li), (PGM_P)_liTempl, id, link, label); |
|
|
|
|
|
|
|
return String(li); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|