mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-31 02:59:10 +03:00
rename system info -> settings and report -> info
This commit is contained in:
@@ -9,8 +9,8 @@ import StarIcon from "@material-ui/icons/Star";
|
|||||||
import ImportExportIcon from "@material-ui/icons/ImportExport";
|
import ImportExportIcon from "@material-ui/icons/ImportExport";
|
||||||
import BugReportIcon from "@material-ui/icons/BugReportTwoTone";
|
import BugReportIcon from "@material-ui/icons/BugReportTwoTone";
|
||||||
|
|
||||||
|
export const WebAPISystemSettings = window.location.origin + "/api?device=system&cmd=settings";
|
||||||
export const WebAPISystemInfo = window.location.origin + "/api?device=system&cmd=info";
|
export const WebAPISystemInfo = window.location.origin + "/api?device=system&cmd=info";
|
||||||
export const WebAPISystemReport = window.location.origin + "/api?device=system&cmd=report";
|
|
||||||
|
|
||||||
class EMSESPHelp extends Component {
|
class EMSESPHelp extends Component {
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ class EMSESPHelp extends Component {
|
|||||||
<ImportExportIcon />
|
<ImportExportIcon />
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
<ListItemText>
|
<ListItemText>
|
||||||
To export your system settings <Link target="_blank" href={WebAPISystemInfo} color="primary">{'click here'}</Link>
|
To list your system settings <Link target="_blank" href={WebAPISystemSettings} color="primary">{'click here'}</Link>
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class EMSESPHelp extends Component {
|
|||||||
<BugReportIcon />
|
<BugReportIcon />
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
<ListItemText>
|
<ListItemText>
|
||||||
To create a report of the current EMS-ESP status (for troubleshooting) <Link target="_blank" href={WebAPISystemReport} color="primary">{'click here'}</Link>
|
To create a report of the current EMS-ESP status <Link target="_blank" href={WebAPISystemInfo} color="primary">{'click here'}</Link>
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
// common words
|
// common words
|
||||||
MAKE_PSTR_WORD(exit)
|
MAKE_PSTR_WORD(exit)
|
||||||
MAKE_PSTR_WORD(help)
|
MAKE_PSTR_WORD(help)
|
||||||
MAKE_PSTR_WORD(settings)
|
|
||||||
MAKE_PSTR_WORD(log)
|
MAKE_PSTR_WORD(log)
|
||||||
MAKE_PSTR_WORD(logout)
|
MAKE_PSTR_WORD(logout)
|
||||||
MAKE_PSTR_WORD(enabled)
|
MAKE_PSTR_WORD(enabled)
|
||||||
@@ -77,8 +76,8 @@ MAKE_PSTR_WORD(data)
|
|||||||
MAKE_PSTR_WORD(command)
|
MAKE_PSTR_WORD(command)
|
||||||
MAKE_PSTR_WORD(commands)
|
MAKE_PSTR_WORD(commands)
|
||||||
MAKE_PSTR_WORD(info)
|
MAKE_PSTR_WORD(info)
|
||||||
MAKE_PSTR_WORD(report)
|
|
||||||
MAKE_PSTR_WORD(test)
|
MAKE_PSTR_WORD(test)
|
||||||
|
MAKE_PSTR_WORD(settings)
|
||||||
|
|
||||||
// devices
|
// devices
|
||||||
MAKE_PSTR_WORD(boiler)
|
MAKE_PSTR_WORD(boiler)
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ void System::start() {
|
|||||||
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(publish), System::command_publish);
|
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(publish), System::command_publish);
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(fetch), System::command_fetch);
|
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(fetch), System::command_fetch);
|
||||||
Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(info), System::command_info);
|
Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(info), System::command_info);
|
||||||
Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(report), System::command_report);
|
Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(settings), System::command_settings);
|
||||||
|
|
||||||
#if defined(EMSESP_TEST)
|
#if defined(EMSESP_TEST)
|
||||||
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(test), System::command_test);
|
Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(test), System::command_test);
|
||||||
@@ -902,9 +902,9 @@ bool System::check_upgrade() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// export all settings to JSON text
|
// export all settings to JSON text
|
||||||
// http://ems-esp/api?device=system&cmd=info
|
// http://ems-esp/api?device=system&cmd=settings
|
||||||
// value and id are ignored
|
// value and id are ignored
|
||||||
bool System::command_info(const char * value, const int8_t id, JsonObject & json) {
|
bool System::command_settings(const char * value, const int8_t id, JsonObject & json) {
|
||||||
#ifdef EMSESP_STANDALONE
|
#ifdef EMSESP_STANDALONE
|
||||||
json["test"] = "testing system info command";
|
json["test"] = "testing system info command";
|
||||||
#else
|
#else
|
||||||
@@ -977,7 +977,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & json
|
|||||||
JsonObject node = json.createNestedObject("Settings");
|
JsonObject node = json.createNestedObject("Settings");
|
||||||
node["tx_mode"] = settings.tx_mode;
|
node["tx_mode"] = settings.tx_mode;
|
||||||
node["ems_bus_id"] = settings.ems_bus_id;
|
node["ems_bus_id"] = settings.ems_bus_id;
|
||||||
node["syslog_enabled"] = settings.syslog_enabled;
|
node["syslog_enabled"] = Helpers::render_boolean(s, settings.syslog_enabled);
|
||||||
node["syslog_level"] = settings.syslog_level;
|
node["syslog_level"] = settings.syslog_level;
|
||||||
node["syslog_mark_interval"] = settings.syslog_mark_interval;
|
node["syslog_mark_interval"] = settings.syslog_mark_interval;
|
||||||
node["syslog_host"] = settings.syslog_host;
|
node["syslog_host"] = settings.syslog_host;
|
||||||
@@ -999,9 +999,9 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & json
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// export debug information
|
// export status information including some basic settings
|
||||||
// http://ems-esp/api?device=system&cmd=report
|
// http://ems-esp/api?device=system&cmd=info
|
||||||
bool System::command_report(const char * value, const int8_t id, JsonObject & json) {
|
bool System::command_info(const char * value, const int8_t id, JsonObject & json) {
|
||||||
JsonObject node;
|
JsonObject node;
|
||||||
|
|
||||||
node = json.createNestedObject("System");
|
node = json.createNestedObject("System");
|
||||||
@@ -1043,6 +1043,7 @@ bool System::command_report(const char * value, const int8_t id, JsonObject & js
|
|||||||
node["api_enabled"] = Helpers::render_boolean(s, settings.api_enabled);
|
node["api_enabled"] = Helpers::render_boolean(s, settings.api_enabled);
|
||||||
node["bool_format"] = settings.bool_format;
|
node["bool_format"] = settings.bool_format;
|
||||||
node["analog_enabled"] = Helpers::render_boolean(s, settings.analog_enabled);
|
node["analog_enabled"] = Helpers::render_boolean(s, settings.analog_enabled);
|
||||||
|
// node["mqtt_enabled"] = Helpers::render_boolean(s, settings.; // TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
node = json.createNestedObject("Status");
|
node = json.createNestedObject("Status");
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class System {
|
|||||||
static bool command_publish(const char * value, const int8_t id);
|
static bool command_publish(const char * value, const int8_t id);
|
||||||
static bool command_fetch(const char * value, const int8_t id);
|
static bool command_fetch(const char * value, const int8_t id);
|
||||||
static bool command_info(const char * value, const int8_t id, JsonObject & json);
|
static bool command_info(const char * value, const int8_t id, JsonObject & json);
|
||||||
static bool command_report(const char * value, const int8_t id, JsonObject & json);
|
static bool command_settings(const char * value, const int8_t id, JsonObject & json);
|
||||||
|
|
||||||
#if defined(EMSESP_TEST)
|
#if defined(EMSESP_TEST)
|
||||||
static bool command_test(const char * value, const int8_t id);
|
static bool command_test(const char * value, const int8_t id);
|
||||||
|
|||||||
Reference in New Issue
Block a user