diff --git a/src/web/AmsWebServer.cpp b/src/web/AmsWebServer.cpp index c6a4d354..38822033 100644 --- a/src/web/AmsWebServer.cpp +++ b/src/web/AmsWebServer.cpp @@ -134,6 +134,11 @@ void AmsWebServer::indexHtml() { String html = String((const __FlashStringHelper*) INDEX_HTML); html.replace("${version}", VERSION); + + if(WiFi.getMode() != WIFI_AP) { + html.replace("boot.css", BOOTSTRAP_URL); + } + html.replace("${data.P}", String(p)); html.replace("${data.PO}", String(po)); html.replace("${display.production}", config->getProductionCapacity() > 0 ? "" : "none"); @@ -186,6 +191,10 @@ void AmsWebServer::configMeterHtml() { String html = String((const __FlashStringHelper*) CONFIGMETER_HTML); html.replace("${version}", VERSION); + if(WiFi.getMode() != WIFI_AP) { + html.replace("boot.css", BOOTSTRAP_URL); + } + server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server.sendHeader("Pragma", "no-cache"); @@ -216,6 +225,10 @@ void AmsWebServer::configWifiHtml() { String html = String((const __FlashStringHelper*) CONFIGWIFI_HTML); html.replace("${version}", VERSION); + if(WiFi.getMode() != WIFI_AP) { + html.replace("boot.css", BOOTSTRAP_URL); + } + server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server.sendHeader("Pragma", "no-cache"); @@ -239,6 +252,10 @@ void AmsWebServer::configMqttHtml() { String html = String((const __FlashStringHelper*) CONFIGMQTT_HTML); html.replace("${version}", VERSION); + if(WiFi.getMode() != WIFI_AP) { + html.replace("boot.css", BOOTSTRAP_URL); + } + server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server.sendHeader("Pragma", "no-cache"); @@ -264,6 +281,10 @@ void AmsWebServer::configWebHtml() { String html = String((const __FlashStringHelper*) CONFIGWEB_HTML); html.replace("${version}", VERSION); + if(WiFi.getMode() != WIFI_AP) { + html.replace("boot.css", BOOTSTRAP_URL); + } + server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server.sendHeader("Pragma", "no-cache"); diff --git a/src/web/AmsWebServer.h b/src/web/AmsWebServer.h index 7c82a836..e43d4aea 100644 --- a/src/web/AmsWebServer.h +++ b/src/web/AmsWebServer.h @@ -1,6 +1,8 @@ #ifndef _AMSWEBSERVER_h #define _AMSWEBSERVER_h +#define BOOTSTRAP_URL "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" + #include #include #include "AmsConfiguration.h" diff --git a/web/boot.css b/web/boot.css index a0717303..e0630a43 100644 --- a/web/boot.css +++ b/web/boot.css @@ -1,15 +1,3 @@ -/* Common custom style */ -.bg-purple { - background-color: var(--purple); -} - -.navbar .navbar-nav-svg { - display: inline-block; - width: 2rem; - height: 2rem; - vertical-align: text-top; -} - /* Ripped necessary style from bootstrap 4.4.1 to make the page look good without internet access. Meant to be overridden by CSS from CDN */ :root { --blue: #007bff; diff --git a/web/configmeter.html b/web/configmeter.html index 10ef3f1f..80019693 100644 --- a/web/configmeter.html +++ b/web/configmeter.html @@ -5,11 +5,10 @@ AMS reader - Meter configuration -
-