mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-04-27 12:39:40 +00:00
Stripped jquery and full bootstrap from image
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
#include "configuration_html.h"
|
#include "configuration_html.h"
|
||||||
#include "bootstrap_css.h"
|
#include "bootstrap_css.h"
|
||||||
#include "application_css.h"
|
#include "application_css.h"
|
||||||
#include "jquery_js.h"
|
|
||||||
#include "gaugemeter_js.h"
|
#include "gaugemeter_js.h"
|
||||||
#include "index_js.h"
|
#include "index_js.h"
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ void AmsWebServer::setup(configuration* config, Stream* debugger) {
|
|||||||
server.on("/configuration", std::bind(&AmsWebServer::configurationHtml, this));
|
server.on("/configuration", std::bind(&AmsWebServer::configurationHtml, this));
|
||||||
server.on("/css/bootstrap.css", std::bind(&AmsWebServer::bootstrapCss, this));
|
server.on("/css/bootstrap.css", std::bind(&AmsWebServer::bootstrapCss, this));
|
||||||
server.on("/css/application.css", std::bind(&AmsWebServer::applicationCss, this));
|
server.on("/css/application.css", std::bind(&AmsWebServer::applicationCss, this));
|
||||||
server.on("/js/jquery.js", std::bind(&AmsWebServer::jqueryJs, this));
|
|
||||||
server.on("/js/gaugemeter.js", std::bind(&AmsWebServer::gaugemeterJs, this));
|
server.on("/js/gaugemeter.js", std::bind(&AmsWebServer::gaugemeterJs, this));
|
||||||
server.on("/js/index.js", std::bind(&AmsWebServer::indexJs, this));
|
server.on("/js/index.js", std::bind(&AmsWebServer::indexJs, this));
|
||||||
server.on("/data.json", std::bind(&AmsWebServer::dataJson, this));
|
server.on("/data.json", std::bind(&AmsWebServer::dataJson, this));
|
||||||
@@ -91,11 +89,10 @@ void AmsWebServer::indexHtml() {
|
|||||||
if(!checkSecurity(2))
|
if(!checkSecurity(2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String html = INDEX_HTML;
|
String html = String((const __FlashStringHelper*) INDEX_HTML);
|
||||||
html.replace("${version}", VERSION);
|
html.replace("${version}", VERSION);
|
||||||
if(WiFi.getMode() != WIFI_AP) {
|
if(WiFi.getMode() != WIFI_AP) {
|
||||||
html.replace("/css/bootstrap.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css");
|
html.replace("/css/bootstrap.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css");
|
||||||
html.replace("/js/jquery.js", "https://code.jquery.com/jquery-3.4.1.min.js");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
@@ -110,11 +107,10 @@ void AmsWebServer::configurationHtml() {
|
|||||||
if(!checkSecurity(1))
|
if(!checkSecurity(1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String html = CONFIGURATION_HTML;
|
String html = String((const __FlashStringHelper*) CONFIGURATION_HTML);
|
||||||
html.replace("${version}", VERSION);
|
html.replace("${version}", VERSION);
|
||||||
if(WiFi.getMode() != WIFI_AP) {
|
if(WiFi.getMode() != WIFI_AP) {
|
||||||
html.replace("/css/bootstrap.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css");
|
html.replace("/css/bootstrap.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css");
|
||||||
html.replace("/js/jquery.js", "https://code.jquery.com/jquery-3.4.1.min.js");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
@@ -191,15 +187,6 @@ void AmsWebServer::applicationCss() {
|
|||||||
server.send(200, "text/css", APPLICATION_CSS);
|
server.send(200, "text/css", APPLICATION_CSS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmsWebServer::jqueryJs() {
|
|
||||||
println("Serving /jquery.js over http...");
|
|
||||||
|
|
||||||
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
||||||
server.sendHeader("Pragma", "no-cache");
|
|
||||||
server.sendHeader("Expires", "-1");
|
|
||||||
server.send(200, "application/javascript", JQUERY_JS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AmsWebServer::gaugemeterJs() {
|
void AmsWebServer::gaugemeterJs() {
|
||||||
println("Serving /gaugemeter.js over http...");
|
println("Serving /gaugemeter.js over http...");
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ private:
|
|||||||
void configurationHtml();
|
void configurationHtml();
|
||||||
void bootstrapCss();
|
void bootstrapCss();
|
||||||
void applicationCss();
|
void applicationCss();
|
||||||
void jqueryJs();
|
|
||||||
void gaugemeterJs();
|
void gaugemeterJs();
|
||||||
void indexJs();
|
void indexJs();
|
||||||
void dataJson();
|
void dataJson();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@ const char INDEX_HTML[] PROGMEM = R"=="==(
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<link rel="stylesheet" type="text/css" href="/css/bootstrap.css"/>
|
<link rel="stylesheet" type="text/css" href="/css/bootstrap.css"/>
|
||||||
<link rel="stylesheet" type="text/css" href="/css/application.css"/>
|
<link rel="stylesheet" type="text/css" href="/css/application.css"/>
|
||||||
<script src="/js/jquery.js"></script>
|
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||||
<script src="/js/gaugemeter.js"></script>
|
<script src="/js/gaugemeter.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-light">
|
<body class="bg-light">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user