/* webinterface.cpp - esp8266 configuration class Copyright (c) 2014 Luc Lebosse. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "webinterface.h" #include "wifi.h" #include #include #include #include extern "C" { #include "user_interface.h" } #define PAGE_HEAD "\n\n\n\n" \ "\nWifi Configuration" \ "\n\n"\ "
" #define NAV_START "" #define PAGE_BOTTOM "\n" //cannot put it in class then cast it as std::function so put outside void handle_web_interface_root() { String sbuf=PAGE_HEAD ; String IP; if (wifi_get_opmode()==WIFI_STA ) IP=wifi_config.ip2str(WiFi.localIP()); else IP=wifi_config.ip2str(WiFi.softAPIP()); sbuf+=NAV_START ; sbuf+=NAV_LEFT_PART1 ; sbuf+=NAV_ELEMENT_ACTIVE ; sbuf+=NAV_LEFT_PART2a ; sbuf+=IP; sbuf+=NAV_LEFT_PART2b ; sbuf+=NAV_LEFT_PART3a ; sbuf+=IP; sbuf+=NAV_LEFT_PART3b ; sbuf+=NAV_RIGHT_PART ; sbuf+=NAV_END ; /* if (web_interface.WebServer.arg("myinput").length()> 0) { char buf[250]; char buf1[250]; web_interface.WebServer.arg("myinput").toCharArray(buf1, 249); web_interface.urldecode(buf,buf1); sbuf="