Some final changes before releasing for test

This commit is contained in:
Gunnar Skjold 2022-02-20 20:10:08 +01:00
parent 705b3e34d1
commit 5ae56f265e
6 changed files with 12 additions and 9 deletions

View File

@ -47,7 +47,7 @@
#include "root/dayplot_json.h"
#include "root/monthplot_json.h"
#include "root/energyprice_json.h"
#include "root/energyaccounting_html.h"
#include "root/thresholds_html.h"
#include "root/configfile_html.h"
#include "base64.h"
@ -82,7 +82,7 @@ void AmsWebServer::setup(AmsConfiguration* config, GpioConfig* gpioConfig, Meter
server.on("/web", HTTP_GET, std::bind(&AmsWebServer::configWebHtml, this));
server.on("/domoticz",HTTP_GET, std::bind(&AmsWebServer::configDomoticzHtml, this));
server.on("/entsoe",HTTP_GET, std::bind(&AmsWebServer::configEntsoeHtml, this));
server.on("/accounting",HTTP_GET, std::bind(&AmsWebServer::configEnergyAccountingHtml, this));
server.on("/thresholds",HTTP_GET, std::bind(&AmsWebServer::configThresholdsHtml, this));
server.on("/boot.css", HTTP_GET, std::bind(&AmsWebServer::bootCss, this));
server.on("/github.svg", HTTP_GET, std::bind(&AmsWebServer::githubSvg, this));
server.on("/data.json", HTTP_GET, std::bind(&AmsWebServer::dataJson, this));
@ -661,15 +661,15 @@ void AmsWebServer::configEntsoeHtml() {
}
}
void AmsWebServer::configEnergyAccountingHtml() {
printD("Serving /accounting.html over http...");
void AmsWebServer::configThresholdsHtml() {
printD("Serving /thresholds.html over http...");
if(!checkSecurity(1))
return;
EnergyAccountingConfig* config = ea->getConfig();
String html = String((const __FlashStringHelper*) ENERGYACCOUNTING_HTML);
String html = String((const __FlashStringHelper*) THRESHOLDS_HTML);
for(int i = 0; i < 9; i++) {
html.replace("{t" + String(i) + "}", String(config->thresholds[i]));
}

View File

@ -84,7 +84,7 @@ private:
void configNtpHtml();
void configGpioHtml();
void configDebugHtml();
void configEnergyAccountingHtml();
void configThresholdsHtml();
void bootCss();
void githubSvg();
void dataJson();

View File

@ -62,7 +62,6 @@
<a class="dropdown-item" href="/mqtt">MQTT</a>
<a class="dropdown-item" href="/web">Web</a>
<a class="dropdown-item" href="/ntp">NTP</a>
<a class="dropdown-item" href="/accounting">Thresholds</a>
<a class="dropdown-item" href="/entsoe">ENTSO-E API</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://github.com/gskjold/AmsToMqttBridge/wiki" target="_blank">Documentation</a>

View File

@ -62,7 +62,6 @@
<a class="dropdown-item" href="/mqtt">MQTT</a>
<a class="dropdown-item" href="/web">Web</a>
<a class="dropdown-item" href="/ntp">NTP</a>
<a class="dropdown-item" href="/accounting">Thresholds</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://github.com/gskjold/AmsToMqttBridge/wiki" target="_blank">Documentation</a>
</div>

View File

@ -114,6 +114,11 @@
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-12">
<a href="/thresholds">Configure tariff thresholds</a>
</div>
</div>
</div>
<hr/>
<div class="row form-group">

View File

@ -107,7 +107,7 @@
<hr/>
<div class="row form-group">
<div class="col-6">
<a href="/" class="btn btn-outline-secondary">Back</a>
<a href="/meter" class="btn btn-outline-secondary">Back</a>
</div>
<div class="col-6 text-right">
<button class="btn btn-primary">Save</button>