remove templates, forgotten commits

pull/30/head
Thorsten von Eicken 10 years ago
parent bb71b1f07e
commit 291c92e557
  1. 1
      lib/heatshrink
  2. 20
      user/cgi.c
  3. 4
      user/cgi.h
  4. 2
      user/cgiflash.c
  5. 2
      user/cgiwifi.c
  6. 17
      user/user_main.c

@ -1 +0,0 @@
Subproject commit 555f7cf0b0a508c2f804d4fdf6c1fd0d92f9a798

@ -52,13 +52,15 @@ int ICACHE_FLASH_ATTR printGlobalInfo(char *buff, int buflen, char *token) {
}
#endif
void ICACHE_FLASH_ATTR printGlobalJSON(HttpdConnData *connData) {
httpdSend(connData,
"<script type=\"text/javascript\">\n"
"var menu = [\"Home\", \"/home.tpl\", \"Wifi\", \"/wifi/wifi.tpl\","
"\"\xC2\xB5" "C Console\", \"/console.tpl\", \"Debug log\", \"/log.tpl\" ];\n", -1);
# define VERS_STR_STR(V) #V
# define VERS_STR(V) VERS_STR_STR(V)
httpdSend(connData, "version = \"" VERS_STR(VERSION) "\";\n", -1);
httpdSend(connData, "</script>\n", -1);
extern char *esp_link_version; // in user_main.c
int ICACHE_FLASH_ATTR cgiMenu(HttpdConnData *connData) {
char buff[1024];
jsonHeader(connData, 200);
os_sprintf(buff,
"{\"menu\": [\"Home\", \"/home.html\", \"Wifi\", \"/wifi/wifi.html\","
"\"\xC2\xB5" "C Console\", \"/console.html\", \"Debug log\", \"/log.html\" ],\n"
" \"version\": \"%s\" }", esp_link_version);
httpdSend(connData, buff, -1);
return HTTPD_CGI_DONE;
}

@ -3,7 +3,7 @@
#include "httpd.h"
void ICACHE_FLASH_ATTR jsonHeader(HttpdConnData *connData, int code);
void ICACHE_FLASH_ATTR printGlobalJSON(HttpdConnData *connData);
void jsonHeader(HttpdConnData *connData, int code);
int cgiMenu(HttpdConnData *connData);
#endif

@ -125,7 +125,7 @@ int ICACHE_FLASH_ATTR cgiUploadFirmware(HttpdConnData *connData) {
// erase next flash block if necessary
if (address % SPI_FLASH_SEC_SIZE == 0){
os_printf("Erasing flash at 0x%05x (id=%d)\n", address, 2-id);
os_printf("Flashing 0x%05x (id=%d)\n", address, 2-id);
spi_flash_erase_sector(address/SPI_FLASH_SEC_SIZE);
}

@ -511,7 +511,7 @@ int ICACHE_FLASH_ATTR printWifiInfo(char *buff) {
len += os_sprintf(buff+len, ", \"ip\": \"%d.%d.%d.%d\"", IP2STR(&info.ip.addr));
len += os_sprintf(buff+len, ", \"netmask\": \"%d.%d.%d.%d\"", IP2STR(&info.netmask.addr));
len += os_sprintf(buff+len, ", \"gateway\": \"%d.%d.%d.%d\"", IP2STR(&info.gw.addr));
len += os_sprintf(buff+len, ", \"hostname\": \"%s\"", wifi_station_get_hostname());
len += os_sprintf(buff+len, ", \"hostname\": \"%s\"", flashConfig.hostname);
} else {
len += os_sprintf(buff+len, ", \"ip\": \"-none-\"");
}

@ -59,28 +59,27 @@ general ones. Authorization things (like authBasic) act as a 'barrier' and
should be placed above the URLs they protect.
*/
HttpdBuiltInUrl builtInUrls[]={
{"/", cgiRedirect, "/home.tpl"},
{"/", cgiRedirect, "/home.html"},
{"/menu", cgiMenu, NULL},
{"/flash/next", cgiGetFirmwareNext, NULL},
{"/flash/upload", cgiUploadFirmware, NULL},
{"/flash/reboot", cgiRebootFirmware, NULL},
{"/home.tpl", cgiEspFsHtml, NULL},
//{"/help.tpl", cgiEspFsTemplate, tplCounter},
{"/log.tpl", cgiEspFsHtml, NULL},
//{"/home.html", cgiEspFsHtml, NULL},
//{"/log.html", cgiEspFsHtml, NULL},
{"/log/text", ajaxLog, NULL},
{"/console.tpl", cgiEspFsHtml, NULL},
//{"/console.html", cgiEspFsHtml, NULL},
{"/console/reset", ajaxConsoleReset, NULL},
{"/console/baud", ajaxConsoleBaud, NULL},
{"/console/text", ajaxConsole, NULL},
{"/help.tpl", cgiEspFsHtml, NULL},
//Routines to make the /wifi URL and everything beneath it work.
//Enable the line below to protect the WiFi configuration with an username/password combo.
// {"/wifi/*", authBasic, myPassFn},
{"/wifi", cgiRedirect, "/wifi/wifi.tpl"},
{"/wifi/", cgiRedirect, "/wifi/wifi.tpl"},
{"/wifi/wifi.tpl", cgiEspFsHtml, NULL},
{"/wifi", cgiRedirect, "/wifi/wifi.html"},
{"/wifi/", cgiRedirect, "/wifi/wifi.html"},
//{"/wifi/wifi.html", cgiEspFsHtml, NULL},
{"/wifi/info", cgiWifiInfo, NULL},
{"/wifi/scan", cgiWiFiScan, NULL},
{"/wifi/connect", cgiWiFiConnect, NULL},

Loading…
Cancel
Save