mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-09-14 14:14:09 +00:00
get and send system name in AuthenticaionContext to prevent /rest/settings on each render
This commit is contained in:
@@ -321,12 +321,15 @@ uint8_t WebStatusService::upgradeImportantMessages(std::string & version) {
|
||||
}
|
||||
|
||||
// action = getVersions
|
||||
// returns the device's current version for dev and stable
|
||||
// returns the device's current version for dev and stable, plus the system name
|
||||
// The remote fetch runs from the main loop task via WebStatusService::loop() so that we never block the AsyncTCP callback
|
||||
void WebStatusService::getVersions(JsonObject root) {
|
||||
FirmwareVersion current_version(current_version_s);
|
||||
bool is_dev = current_version.prerelease().find("dev") != std::string::npos;
|
||||
|
||||
// the WebUI shows this in the menu drawer. It's included here because this action is called once after login
|
||||
root["system_name"] = EMSESP::system_.system_name();
|
||||
|
||||
JsonObject current = root["current"].to<JsonObject>();
|
||||
current["version"] = current_version_s;
|
||||
current["type"] = is_dev ? "dev" : "stable";
|
||||
|
||||
Reference in New Issue
Block a user