diff --git a/main/config.h b/main/config.h index 121f5b0..7304cc4 100644 --- a/main/config.h +++ b/main/config.h @@ -269,3 +269,5 @@ const char *const language_names[] = { #endif static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *); + +// #define METRICS 1 // un comment to enable Prometheus exporter diff --git a/main/languages/vi-VN.h b/main/languages/vi-VN.h index a2400b8..ef83d38 100644 --- a/main/languages/vi-VN.h +++ b/main/languages/vi-VN.h @@ -92,7 +92,7 @@ namespace vi // Page Status const char txt_status_title[] PROGMEM = "Trạng thái"; const char txt_status_hvac[] PROGMEM = "Trạng thái ĐH"; - const char txt_retries_hvac[] PROGMEM = "HVAC Connection Retries"; + const char txt_retries_hvac[] PROGMEM = "ĐH thử lại kết nối"; const char txt_status_mqtt[] PROGMEM = "Trạng thái MQTT"; const char txt_status_wifi_ip[] PROGMEM = "WIFI IP"; const char txt_failed_get_wifi_ip[] PROGMEM = "Lỗi khi lấy địa chỉ IP"; diff --git a/main/main.cpp b/main/main.cpp index ec386f6..4247121 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -20,7 +20,9 @@ #include "html_init.h" // code html for initial config #include "html_menu.h" // code html for menu #include "html_pages.h" // code html for pages +#ifdef METRICS #include "html_metrics.h" // prometheus metrics +#endif // Start header for build with IDF and Platformio bool loadWifi(); @@ -213,7 +215,9 @@ void setup() server.on("/unit", handleUnit); server.on("/status", handleStatus); server.on("/others", handleOthers); +#ifdef METRICS server.on("/metrics", handleMetrics); +#endif server.onNotFound(handleNotFound); if (login_password.length() > 0) {