From efcbd8192747c3bbf16e32f613385fea4ce02f19 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Mon, 8 May 2023 21:43:50 +0200 Subject: [PATCH] Feature: Add used PIO environment to the system info page --- platformio.ini | 1 + src/WebApi_sysstatus.cpp | 1 + webapp/src/components/FirmwareInfo.vue | 4 ++++ webapp/src/locales/de.json | 1 + webapp/src/locales/en.json | 1 + webapp/src/locales/fr.json | 1 + webapp/src/types/SystemStatus.ts | 1 + 7 files changed, 10 insertions(+) diff --git a/platformio.ini b/platformio.ini index f3fc2a5..e365594 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,6 +19,7 @@ platform = espressif32@6.1.0 build_flags = -DCOMPONENT_EMBED_FILES=webapp_dist/index.html.gz:webapp_dist/zones.json.gz:webapp_dist/favicon.ico:webapp_dist/js/app.js.gz + -DPIOENV=\"$PIOENV\" -Wall -Wextra -Werror -std=c++17 -std=gnu++17 diff --git a/src/WebApi_sysstatus.cpp b/src/WebApi_sysstatus.cpp index 58af907..fbb392d 100644 --- a/src/WebApi_sysstatus.cpp +++ b/src/WebApi_sysstatus.cpp @@ -67,6 +67,7 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request) snprintf(version, sizeof(version), "%d.%d.%d", CONFIG_VERSION >> 24 & 0xff, CONFIG_VERSION >> 16 & 0xff, CONFIG_VERSION >> 8 & 0xff); root["config_version"] = version; root["git_hash"] = AUTO_GIT_HASH; + root["pioenv"] = PIOENV; root["uptime"] = esp_timer_get_time() / 1000000; diff --git a/webapp/src/components/FirmwareInfo.vue b/webapp/src/components/FirmwareInfo.vue index afc03cf..6dd69a1 100644 --- a/webapp/src/components/FirmwareInfo.vue +++ b/webapp/src/components/FirmwareInfo.vue @@ -22,6 +22,10 @@ {{ systemStatus.git_hash }} + + {{ $t('firmwareinfo.PioEnv') }} + {{ systemStatus.pioenv }} + {{ $t('firmwareinfo.FirmwareUpdate') }}