|
|
@ -2,9 +2,11 @@ |
|
|
|
#include "cgiwifi.h" |
|
|
|
#include "cgiwifi.h" |
|
|
|
#include "cgi.h" |
|
|
|
#include "cgi.h" |
|
|
|
#include "config.h" |
|
|
|
#include "config.h" |
|
|
|
#include "syslog.h" |
|
|
|
|
|
|
|
#include "sntp.h" |
|
|
|
#include "sntp.h" |
|
|
|
#include "cgimqtt.h" |
|
|
|
#include "cgimqtt.h" |
|
|
|
|
|
|
|
#ifdef SYSLOG |
|
|
|
|
|
|
|
#include "syslog.h" |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef CGISERVICES_DBG |
|
|
|
#ifdef CGISERVICES_DBG |
|
|
|
#define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) |
|
|
|
#define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) |
|
|
@ -109,21 +111,25 @@ int ICACHE_FLASH_ATTR cgiServicesInfo(HttpdConnData *connData) { |
|
|
|
|
|
|
|
|
|
|
|
os_sprintf(buff, |
|
|
|
os_sprintf(buff, |
|
|
|
"{ " |
|
|
|
"{ " |
|
|
|
|
|
|
|
#ifdef SYSLOG |
|
|
|
"\"syslog_host\": \"%s\", " |
|
|
|
"\"syslog_host\": \"%s\", " |
|
|
|
"\"syslog_minheap\": %d, " |
|
|
|
"\"syslog_minheap\": %d, " |
|
|
|
"\"syslog_filter\": %d, " |
|
|
|
"\"syslog_filter\": %d, " |
|
|
|
"\"syslog_showtick\": \"%s\", " |
|
|
|
"\"syslog_showtick\": \"%s\", " |
|
|
|
"\"syslog_showdate\": \"%s\", " |
|
|
|
"\"syslog_showdate\": \"%s\", " |
|
|
|
|
|
|
|
#endif |
|
|
|
"\"timezone_offset\": %d, " |
|
|
|
"\"timezone_offset\": %d, " |
|
|
|
"\"sntp_server\": \"%s\", " |
|
|
|
"\"sntp_server\": \"%s\", " |
|
|
|
"\"mdns_enable\": \"%s\", " |
|
|
|
"\"mdns_enable\": \"%s\", " |
|
|
|
"\"mdns_servername\": \"%s\"" |
|
|
|
"\"mdns_servername\": \"%s\"" |
|
|
|
" }", |
|
|
|
" }", |
|
|
|
|
|
|
|
#ifdef SYSLOG |
|
|
|
flashConfig.syslog_host, |
|
|
|
flashConfig.syslog_host, |
|
|
|
flashConfig.syslog_minheap, |
|
|
|
flashConfig.syslog_minheap, |
|
|
|
flashConfig.syslog_filter, |
|
|
|
flashConfig.syslog_filter, |
|
|
|
flashConfig.syslog_showtick ? "enabled" : "disabled", |
|
|
|
flashConfig.syslog_showtick ? "enabled" : "disabled", |
|
|
|
flashConfig.syslog_showdate ? "enabled" : "disabled", |
|
|
|
flashConfig.syslog_showdate ? "enabled" : "disabled", |
|
|
|
|
|
|
|
#endif |
|
|
|
flashConfig.timezone_offset, |
|
|
|
flashConfig.timezone_offset, |
|
|
|
flashConfig.sntp_server, |
|
|
|
flashConfig.sntp_server, |
|
|
|
flashConfig.mdns_enable ? "enabled" : "disabled", |
|
|
|
flashConfig.mdns_enable ? "enabled" : "disabled", |
|
|
@ -151,9 +157,11 @@ int ICACHE_FLASH_ATTR cgiServicesSet(HttpdConnData *connData) { |
|
|
|
syslog |= getBoolArg(connData, "syslog_showdate", &flashConfig.syslog_showdate); |
|
|
|
syslog |= getBoolArg(connData, "syslog_showdate", &flashConfig.syslog_showdate); |
|
|
|
if (syslog < 0) return HTTPD_CGI_DONE; |
|
|
|
if (syslog < 0) return HTTPD_CGI_DONE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SYSLOG |
|
|
|
if (syslog > 0) { |
|
|
|
if (syslog > 0) { |
|
|
|
syslog_init(flashConfig.syslog_host); |
|
|
|
syslog_init(flashConfig.syslog_host); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
int8_t sntp = 0; |
|
|
|
int8_t sntp = 0; |
|
|
|
sntp |= getInt8Arg(connData, "timezone_offset", &flashConfig.timezone_offset); |
|
|
|
sntp |= getInt8Arg(connData, "timezone_offset", &flashConfig.timezone_offset); |
|
|
|