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

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

@ -125,7 +125,7 @@ int ICACHE_FLASH_ATTR cgiUploadFirmware(HttpdConnData *connData) {
// erase next flash block if necessary // erase next flash block if necessary
if (address % SPI_FLASH_SEC_SIZE == 0){ 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); 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, ", \"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, ", \"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, ", \"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 { } else {
len += os_sprintf(buff+len, ", \"ip\": \"-none-\""); 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. should be placed above the URLs they protect.
*/ */
HttpdBuiltInUrl builtInUrls[]={ HttpdBuiltInUrl builtInUrls[]={
{"/", cgiRedirect, "/home.tpl"}, {"/", cgiRedirect, "/home.html"},
{"/menu", cgiMenu, NULL},
{"/flash/next", cgiGetFirmwareNext, NULL}, {"/flash/next", cgiGetFirmwareNext, NULL},
{"/flash/upload", cgiUploadFirmware, NULL}, {"/flash/upload", cgiUploadFirmware, NULL},
{"/flash/reboot", cgiRebootFirmware, NULL}, {"/flash/reboot", cgiRebootFirmware, NULL},
{"/home.tpl", cgiEspFsHtml, NULL}, //{"/home.html", cgiEspFsHtml, NULL},
//{"/help.tpl", cgiEspFsTemplate, tplCounter}, //{"/log.html", cgiEspFsHtml, NULL},
{"/log.tpl", cgiEspFsHtml, NULL},
{"/log/text", ajaxLog, NULL}, {"/log/text", ajaxLog, NULL},
{"/console.tpl", cgiEspFsHtml, NULL}, //{"/console.html", cgiEspFsHtml, NULL},
{"/console/reset", ajaxConsoleReset, NULL}, {"/console/reset", ajaxConsoleReset, NULL},
{"/console/baud", ajaxConsoleBaud, NULL}, {"/console/baud", ajaxConsoleBaud, NULL},
{"/console/text", ajaxConsole, NULL}, {"/console/text", ajaxConsole, NULL},
{"/help.tpl", cgiEspFsHtml, NULL},
//Routines to make the /wifi URL and everything beneath it work. //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. //Enable the line below to protect the WiFi configuration with an username/password combo.
// {"/wifi/*", authBasic, myPassFn}, // {"/wifi/*", authBasic, myPassFn},
{"/wifi", cgiRedirect, "/wifi/wifi.tpl"}, {"/wifi", cgiRedirect, "/wifi/wifi.html"},
{"/wifi/", cgiRedirect, "/wifi/wifi.tpl"}, {"/wifi/", cgiRedirect, "/wifi/wifi.html"},
{"/wifi/wifi.tpl", cgiEspFsHtml, NULL}, //{"/wifi/wifi.html", cgiEspFsHtml, NULL},
{"/wifi/info", cgiWifiInfo, NULL}, {"/wifi/info", cgiWifiInfo, NULL},
{"/wifi/scan", cgiWiFiScan, NULL}, {"/wifi/scan", cgiWiFiScan, NULL},
{"/wifi/connect", cgiWiFiConnect, NULL}, {"/wifi/connect", cgiWiFiConnect, NULL},

Loading…
Cancel
Save