mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Merge pull request #312 from dalathegreat/feature/name-webui
Microfeature: Customizable name on webserver
This commit is contained in:
commit
bcaf3ab5b4
2 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
const char index_html[] = R"rawliteral(
|
const char index_html[] = R"rawliteral(
|
||||||
<!doctypehtml><title>Battery Emulator</title><meta content="width=device-width"name=viewport><style>html{font-family:Arial;display:inline-block;text-align:center}h2{font-size:3rem}body{max-width:800px;margin:0 auto}</style><h2>Battery Emulator</h2>%ABC%
|
<!doctypehtml><title>Battery Emulator</title><meta content="width=device-width"name=viewport><style>html{font-family:Arial;display:inline-block;text-align:center}h2{font-size:3rem}body{max-width:800px;margin:0 auto}</style>%X%
|
||||||
)rawliteral";
|
)rawliteral";
|
||||||
|
|
||||||
/* The above code is minified (https://kangax.github.io/html-minifier/) to increase performance. Here is the full HTML function:
|
/* The above code is minified (https://kangax.github.io/html-minifier/) to increase performance. Here is the full HTML function:
|
||||||
|
@ -14,8 +14,7 @@ const char index_html[] = R"rawliteral(
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>Battery Emulator</h2>
|
%X%
|
||||||
%ABC%
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -358,8 +358,9 @@ void init_ElegantOTA() {
|
||||||
}
|
}
|
||||||
|
|
||||||
String processor(const String& var) {
|
String processor(const String& var) {
|
||||||
if (var == "ABC") {
|
if (var == "X") {
|
||||||
String content = "";
|
String content = "";
|
||||||
|
content += "<h2>" + String(ssidAP) + "</h2>"; // ssidAP name is used as header name
|
||||||
//Page format
|
//Page format
|
||||||
content += "<style>";
|
content += "<style>";
|
||||||
content += "body { background-color: black; color: white; }";
|
content += "body { background-color: black; color: white; }";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue