get and send system name in AuthenticaionContext to prevent /rest/settings on each render

This commit is contained in:
proddy
2026-08-23 12:22:45 +02:00
parent 6efc7113b3
commit 42f86cd12b
6 changed files with 32 additions and 13 deletions
+4 -1
View File
@@ -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";