adds toggle for scan quality as percentage

`setScanDispPerc` until we have decent remplating
This commit is contained in:
Shawn A
2018-02-14 12:42:21 -06:00
parent ba3a2c8451
commit 089c487576
2 changed files with 13 additions and 1 deletions
+10
View File
@@ -674,6 +674,12 @@ String WiFiManager::getScanItemOut(){
bool tok_q = HTTP_ITEM_STR.indexOf(FPSTR(T_q)) > 0;
bool tok_i = HTTP_ITEM_STR.indexOf(FPSTR(T_i)) > 0;
// toggle icons with percentage
bool _scanDispOptions = true;
if(_scanDispOptions && tok_q && !tok_r){
HTTP_ITEM_STR.replace(FPSTR(T_q), FPSTR(HTTP_ITEM_QP));
tok_r = true;
}
//display networks in page
for (int i = 0; i < n; i++) {
@@ -1223,6 +1229,10 @@ void WiFiManager::setWebPortalClientCheck(boolean enabled){
_webClientCheck = enabled;
}
void WiFiManager::setScanDispPerc(boolean enabled){
_scanDispOptions = true;
}
// HELPERS
template <typename Generic>
+3 -1
View File
@@ -10,7 +10,9 @@ const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){document.get
const char HTTP_HEAD_END[] PROGMEM = "</head><body><div class='wrap'>";
const char HTTP_ROOT_MAIN[] PROGMEM = "<h1>{v}</h1><h3>WiFiManager</h3>";
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action='/wifi' method='GET'><button>Configure WiFi</button></form><br/><form action='/0wifi' method='GET'><button>Configure WiFi (No Scan)</button></form><br/><form action='/i' method='GET'><button>Info</button></form><br/><form action='/r' method='GET'><button>Restart</button></form><br/><form action='/exit' method='GET'><button>Quit</button></form>";
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a><div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i}'></div></div>";
const char HTTP_ITEM_QI[] PROGMEM = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i}'></div>";
const char HTTP_ITEM_QP[] PROGMEM = "<div class='q'>{r}%</div>";
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a>{q}</div>";
// const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a> {R} {r}% {q} {e}</div>"; // test all tokens
const char HTTP_FORM_START[] PROGMEM = "<form method='POST' action='wifisave'><label for='s'>SSID</label><input id='s' name='s' maxlength=32 placeholder='{v}'><br/><label for='p'>Password</label><input id='p' name='p' maxlength='64' type='password' placeholder=''><br/>";
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>Save</button></form>";