mirror of https://github.com/lumapu/ahoy.git
Browse Source
* bound html through ajax to parse setup page (not finished now) * added compression option for static html to python module * removed generated h-file from index (redundant information), they will be created on compile timepull/283/head
lumapu
2 years ago
13 changed files with 347 additions and 213 deletions
@ -0,0 +1,100 @@ |
|||
//-----------------------------------------------------------------------------
|
|||
// 2022 Ahoy, https://www.mikrocontroller.net/topic/525778
|
|||
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
|
|||
//-----------------------------------------------------------------------------
|
|||
|
|||
#if defined(ESP32) && defined(F) |
|||
#undef F |
|||
#define F(sl) (sl) |
|||
#endif |
|||
|
|||
#include "api.h" |
|||
#include "AsyncJson.h" |
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
api::api(AsyncWebServer *srv, app *app, sysConfig_t *sysCfg, config_t *config, char version[]) { |
|||
mSrv = srv; |
|||
mApp = app; |
|||
mSysCfg = sysCfg; |
|||
mConfig = config; |
|||
mVersion = version; |
|||
} |
|||
|
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
void api::setup(void) { |
|||
mSrv->on("/api/system", HTTP_GET, std::bind(&api::onSystem, this, std::placeholders::_1)); |
|||
mSrv->on("/api/inverter/list", HTTP_GET, std::bind(&api::onInverterList, this, std::placeholders::_1)); |
|||
mSrv->on("/api/mqtt", HTTP_GET, std::bind(&api::onMqtt, this, std::placeholders::_1)); |
|||
} |
|||
|
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
void api::loop(void) { |
|||
|
|||
} |
|||
|
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
void api::onSystem(AsyncWebServerRequest *request) { |
|||
AsyncJsonResponse* response = new AsyncJsonResponse(); |
|||
JsonObject root = response->getRoot(); |
|||
|
|||
root[F("ssid")] = mSysCfg->stationSsid; |
|||
root[F("device_name")] = mSysCfg->deviceName; |
|||
|
|||
response->setLength(); |
|||
//response->addHeader("Access-Control-Allow-Origin", "*");
|
|||
//response->addHeader("Access-Control-Allow-Headers", "content-type");
|
|||
request->send(response); |
|||
} |
|||
|
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
void api::onInverterList(AsyncWebServerRequest *request) { |
|||
AsyncJsonResponse* response = new AsyncJsonResponse(); |
|||
JsonObject root = response->getRoot(); |
|||
JsonArray invArr = root.createNestedArray("inverter"); |
|||
|
|||
Inverter<> *iv; |
|||
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i ++) { |
|||
iv = mApp->mSys->getInverterByPos(i); |
|||
if(NULL != iv) { |
|||
JsonObject obj = invArr.createNestedObject(); |
|||
obj[F("id")] = i; |
|||
obj[F("name")] = String(iv->name); |
|||
obj[F("serial")] = String(iv->serial.u64, HEX); |
|||
obj[F("channels")] = iv->channels; |
|||
obj[F("version")] = String(iv->fwVersion); |
|||
|
|||
for(uint8_t j = 0; j < iv->channels; j ++) { |
|||
obj[F("ch_max_power")][j] = iv->chMaxPwr[j]; |
|||
obj[F("ch_name")][j] = iv->chName[j]; |
|||
} |
|||
|
|||
obj[F("power_limit")][F("limit")] = iv->powerLimit[0]; |
|||
obj[F("power_limit")][F("limit_option")] = iv->powerLimit[1]; |
|||
} |
|||
} |
|||
root[F("interval")] = String(mConfig->sendInterval); |
|||
root[F("retries")] = String(mConfig->maxRetransPerPyld); |
|||
|
|||
response->setLength(); |
|||
request->send(response); |
|||
} |
|||
|
|||
|
|||
//-----------------------------------------------------------------------------
|
|||
void api::onMqtt(AsyncWebServerRequest *request) { |
|||
AsyncJsonResponse* response = new AsyncJsonResponse(); |
|||
JsonObject root = response->getRoot(); |
|||
|
|||
root[F("broker")] = String(mConfig->mqtt.broker); |
|||
root[F("port")] = String(mConfig->mqtt.port); |
|||
root[F("user")] = String(mConfig->mqtt.user); |
|||
root[F("pwd")] = String(mConfig->mqtt.pwd); // TODO: not that nice!
|
|||
root[F("topic")] = String(mConfig->mqtt.topic); |
|||
|
|||
response->setLength(); |
|||
request->send(response); |
|||
} |
@ -0,0 +1,32 @@ |
|||
#ifndef __API_H__ |
|||
#define __API_H__ |
|||
|
|||
#include "dbg.h" |
|||
#include "ESPAsyncTCP.h" |
|||
#include "ESPAsyncWebServer.h" |
|||
#include "app.h" |
|||
|
|||
|
|||
class app; |
|||
|
|||
class api { |
|||
public: |
|||
api(AsyncWebServer *srv, app *app, sysConfig_t *sysCfg, config_t *config, char version[]); |
|||
|
|||
void setup(void); |
|||
void loop(void); |
|||
|
|||
private: |
|||
void onSystem(AsyncWebServerRequest *request); |
|||
void onInverterList(AsyncWebServerRequest *request); |
|||
void onMqtt(AsyncWebServerRequest *request); |
|||
|
|||
AsyncWebServer *mSrv; |
|||
app *mApp; |
|||
|
|||
config_t *mConfig; |
|||
sysConfig_t *mSysCfg; |
|||
char *mVersion; |
|||
}; |
|||
|
|||
#endif /*__API_H__*/ |
@ -1,100 +0,0 @@ |
|||
#ifndef __FAVICON_ICO_GZ_H__ |
|||
#define __FAVICON_ICO_GZ_H__ |
|||
#define favicon_ico_gz_len 1533 |
|||
const uint8_t favicon_ico_gz[] PROGMEM = {0x1f, 0x8b, 0x08, 0x08, 0xf2, 0xc5, 0xd5, 0x62, 0x04, 0x00, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6f, |
|||
0x6e, 0x2e, 0x69, 0x63, 0x6f, 0x00, 0xed, 0x5c, 0x49, 0x68, 0x13, 0x51, 0x18, 0xfe, 0x62, 0xa3, |
|||
0x51, 0x28, 0xd6, 0x83, 0x82, 0xa0, 0x98, 0xb8, 0x1c, 0xbc, 0x59, 0x11, 0x5c, 0x50, 0xac, 0x88, |
|||
0x8a, 0xb8, 0xdd, 0x3c, 0x89, 0xd0, 0x93, 0x7a, 0x53, 0x51, 0x9b, 0x80, 0x4b, 0x46, 0xad, 0xfb, |
|||
0xd2, 0xb4, 0x2e, 0xb8, 0xa3, 0xc6, 0xba, 0xe1, 0x02, 0xae, 0xad, 0x0a, 0x26, 0x3d, 0xe8, 0xc5, |
|||
0x83, 0x57, 0x31, 0x2d, 0xc1, 0x8b, 0xb7, 0x92, 0x63, 0x0e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0x7a, 0x8d, 0x72, 0xda, 0x73, 0x7d, 0xdb, |
|||
0x8f, 0x29, 0x45, 0xb5, 0x7f, 0x84, 0x4e, 0xfb, 0x71, 0xda, 0xb1, 0x19, 0x9d, 0x05, 0xb5, 0xef, |
|||
0xc5, 0xa5, 0xd1, 0x8e, 0x75, 0xef, 0x56, 0x9c, 0xfa, 0x6f, 0xfb, 0x87, 0x58, 0x86, 0x3c, 0x75, |
|||
0x70, 0x13, 0x96, 0xe5, 0x6a, 0x1f, 0x19, 0xe8, 0x6a, 0x47, 0x81, 0xd5, 0xea, 0x41, 0x7b, 0x56, |
|||
0xfb, 0x50, 0xe0, 0x72, 0xae, 0xed, 0xbe, 0x1a, 0x98, 0xcc, 0xc8, 0xf9, 0x1a, 0x73, 0x70, 0x9a, |
|||
0xda, 0x8f, 0xda, 0xf6, 0xb9, 0x81, 0x49, 0xfd, 0x3e, 0xbc, 0xa5, 0xfd, 0xd7, 0xcf, 0xf9, 0x8f, |
|||
0xf6, 0x1a, 0xff, 0xeb, 0xe7, 0x04, 0x42, 0x13, 0xc3, 0x20, 0x84, 0x00, 0x57, 0x14, 0x68, 0x89, |
|||
0x01, 0xee, 0x38, 0xb0, 0xfa, 0x08, 0x70, 0x64, 0xb5, 0x39, 0xce, 0x78, 0x08, 0x6b, 0x0a, 0x1f, |
|||
0x67, 0x2c, 0x0c, 0xf3, 0x72, 0xf1, 0x18, 0xab, 0xe4, 0x3e, 0x4f, 0x23, 0x88, 0x37, 0xbc, 0xae, |
|||
0xcf, 0x07, 0xaf, 0xf9, 0x1e, 0x48, 0x83, 0x97, 0xf1, 0xba, 0x43, 0x5b, 0xf0, 0x86, 0x8f, 0x87, |
|||
0x4c, 0xd0, 0xfe, 0x5d, 0xc5, 0xeb, 0x28, 0x97, 0x61, 0x33, 0xdf, 0x34, 0x78, 0x39, 0x8f, 0x55, |
|||
0xaa, 0xf4, 0x23, 0x03, 0x81, 0x53, 0x56, 0x1f, 0x54, 0xe8, 0xb3, 0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, 0xe3, 0x42, 0x0d, 0xea, 0x93, |
|||
0x17, 0xc7, 0xed, 0xf3, 0xbe, 0x74, 0x1c, 0x9c, 0x43, 0x0d, 0x6a, 0xc9, 0x12, 0x4c, 0x24, 0xdf, |
|||
0xaf, 0x6c, 0xfe, 0xdf, 0xab, 0xf4, 0xae, 0x28, 0x83, 0xd7, 0x84, 0xba, 0xf1, 0x6e, 0x81, 0xb7, |
|||
0x41, 0x0d, 0xca, 0xca, 0x00, 0xcb, 0x11, 0x75, 0xd1, 0xd7, 0x14, 0x0d, 0xc9, 0x21, 0xc9, 0x51, |
|||
0xc9, 0xfb, 0x24, 0x2f, 0x97, 0x3c, 0x5b, 0xf2, 0x54, 0xc9, 0x2e, 0xc9, 0x4d, 0x7d, 0x26, 0x3b, |
|||
0xe2, 0x26, 0xc3, 0x62, 0x9f, 0xe4, 0xe5, 0x92, 0x57, 0x49, 0x5e, 0x2d, 0xb9, 0x4d, 0xf2, 0x4a, |
|||
0xc3, 0xe4, 0x15, 0x21, 0xb9, 0x7d, 0x54, 0x72, 0xbb, 0xe4, 0x56, 0xc9, 0x33, 0x25, 0x37, 0x4b, |
|||
0x76, 0x49, 0x6e, 0x92, 0xec, 0xb0, 0xf4, 0xec, 0x1c, 0x93, 0x1c, 0x97, 0x9c, 0x90, 0x3c, 0x22, |
|||
0x59, 0x58, 0x7c, 0x46, 0xf2, 0x77, 0xc9, 0x7f, 0x25, 0x8b, 0x82, 0xd8, 0x41, 0x7f, 0x3b, 0x91, |
|||
0xec, 0x8f, 0x10, 0x21, 0x66, 0xfe, 0x67, 0x06, 0xe6, 0x16, 0x21, 0x62, 0xcc, 0x6e, 0x21, 0xe2, |
|||
0xcc, 0x6d, 0x42, 0x24, 0x98, 0xfd, 0x42, 0x8c, 0x30, 0x0b, 0x2a, 0xf6, 0xcf, 0x7c, 0x87, 0x72, |
|||
0x61, 0x4e, 0xe4, 0x67, 0x3f, 0xf3, 0x08, 0x7d, 0x28, 0x4f, 0x16, 0x1c, 0x26, 0x1b, 0x4d, 0xb4, |
|||
0x90, 0x56, 0x85, 0x5c, 0xb4, 0x11, 0x6d, 0x1a, 0x6d, 0x21, 0x55, 0x52, 0x8e, 0x31, 0xf8, 0x31, |
|||
0x2f, 0xe3, 0x75, 0xff, 0x00, 0xd3, 0x39, 0x74, 0x2c, 0x6e, 0x57, 0x00, 0x00}; |
|||
#endif /*__FAVICON_ICO_GZ_H__*/ |
@ -1,5 +0,0 @@ |
|||
#ifndef __INDEX_HTML_H__ |
|||
#define __INDEX_HTML_H__ |
|||
const char index_html[] PROGMEM = "<!doctype html><html><head><title>Index - {DEVICE}</title><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><script type=\"text/javascript\">getAjax('/uptime', 'uptime');getAjax('/cmdstat', 'cmds');window.setInterval(\"getAjax('/uptime', 'uptime')\", {JS_TS});window.setInterval(\"getAjax('/cmdstat', 'cmds')\", {JS_TS});function getAjax(url, resid) {var http = null;http = new XMLHttpRequest();if(http != null) {http.open(\"GET\", url, true);http.onreadystatechange = print;http.send(null);}function print() {if(http.readyState == 4) {document.getElementById(resid).innerHTML = http.responseText;}}}function getInverterInfo(data){var http = null;http = new XMLHttpRequest();if(http != null) {http.open(\"POST\", \"/api\");http.setRequestHeader(\"Accept\", \"application/json\");http.setRequestHeader(\"Content-Type\", \"application/json\");http.send(data);}}</script></head><body><h1>AHOY - {DEVICE}</h1><div id=\"content\" class=\"content\"><p><a href=\"/visualization\">Visualization</a><br/><br/><a href=\"/setup\">Setup</a><br/></p><p><span class=\"des\">Uptime: </span><span id=\"uptime\"></span></p><p><span class=\"des\">Statistics: </span><pre id=\"cmds\"></pre></p><p>Every {TS}seconds the values are updated</p><div id=\"note\">This project was started from <a href=\"https://www.mikrocontroller.net/topic/525778\" target=\"_blank\">this discussion. (Mikrocontroller.net)</a><br/>New updates can be found on Github: <a href=\"https://github.com/grindylow/ahoy\" target=\"_blank\">https://github.com/grindylow/ahoy</a><br/><br/>Please report issues using the feature provided by <a href=\"https://github.com/grindylow/ahoy/issues\">Github</a><br/><br/>Discuss with us on <a href=\"https://discord.gg/WzhxEY62mB\">Discord</a><br/><p class=\"lic\"><a href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/de\">Creative Commons - https://creativecommons.org/licenses/by-nc-sa/3.0/de/</a><br/>Check the licenses which are published on <a href=\"https://github.com/grindylow/ahoy\">https://github.com/grindylow/ahoy</a>as well</p></div></div><div id=\"footer\"><p class=\"left\">© 2022</p><p class=\"left\"><a href=\"/update\">Update Firmware</a></p><p class=\"right\">AHOY :: {VERSION}</p><p class=\"right\"><a href=\"/reboot\">Reboot</a></p><p class=\"right\">Git SHA: {BUILD}</p></div></body></html>"; |
|||
const uint32_t index_html_len = 2317; |
|||
#endif /*__INDEX_HTML_H__*/ |
File diff suppressed because one or more lines are too long
@ -1,5 +0,0 @@ |
|||
#ifndef __STYLE_CSS_H__ |
|||
#define __STYLE_CSS_H__ |
|||
const char style_css[] PROGMEM = "h1 {margin:0;padding:20pt;font-size:22pt;color:#fff;background-color:#006ec0;display:block;text-transform:uppercase;}html, body {font-family:Arial;margin:0;padding:0;}p {text-align:justify;font-size:13pt;}p.lic, p.lic a {font-size:8pt;color:#999;}.des {margin-top:20px;font-size:13pt;color:#006ec0;}.s_active, .s_collapsible:hover {background-color:#006ec0;}.s_content {display:none;overflow:hidden;}.s_collapsible {background-color:#044e86;color:white;cursor:pointer;padding:18px;width:100%;border:none;text-align:left;outline:none;font-size:15px;margin-bottom:4px;}.subdes {font-size:12pt;color:#006ec0;margin-left:7px;}.subsubdes {font-size:12pt;color:#006ec0;margin:0 0 7px 12px;}.hide {display:none;}a:link, a:visited {text-decoration:none;font-size:13pt;color:#006ec0;}a:hover, a:focus {color:#f00;}a.erase {background-color:#006ec0;color:#fff;padding:7px;display:inline-block;margin-top:30px;}#content {padding:15px 15px 60px 15px;}#footer {position:fixed;bottom:0px;height:45px;background-color:#006ec0;width:100%;border-top:5px solid #fff;}#footer p, #footer a {color:#fff;padding:0 7px 0 7px;font-size:10pt !important;}div.content {background-color:#fff;padding-bottom:65px;overflow:auto;}input, select {padding:7px;font-size:13pt;}input.text, select {width:70%;box-sizing:border-box;margin-bottom:10px;border:1px solid #ccc;}input.sh {max-width:150px !important;margin-right:10px;}input.btn {background-color:#006ec0;color:#fff;border:0px;float:right;margin:10px 0 30px;text-transform:uppercase;}input.cb {margin-bottom:20px;}label {width:20%;display:inline-block;font-size:12pt;padding-right:10px;margin:10px 0px 0px 15px;vertical-align:top;}fieldset {margin-bottom:15px;}.left {float:left;}.right {float:right;}div.ch-iv {width:100%;background-color:#32b004;display:inline-block;margin-bottom:15px;padding-bottom:20px;overflow:auto;}div.ch {width:220px;min-height:350px;background-color:#006ec0;display:inline-block;margin:0 10px 15px 10px;overflow:auto;padding-bottom:20px;}div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head {color:#fff;display:block;width:100%;text-align:center;}.subgrp {float:left;width:220px;}div.ch .unit, div.ch-iv .unit {font-size:19px;margin-left:10px;}div.ch .value, div.ch-iv .value {margin-top:20px;font-size:24px;}div.ch .info, div.ch-iv .info {margin-top:3px;font-size:10px;}div.ch .head {background-color:#003c80;padding:10px 0 10px 0;}div.ch-iv .head {background-color:#1c6800;padding:10px 0 10px 0;}div.iv {max-width:960px;margin-bottom:40px;}div.ts {font-size:13px;background-color:#ddd;border-top:7px solid #999;padding:7px;}div.modpwr, div.modname {width:70%;display:inline-block;}#note {margin:50px 10px 10px 10px;padding-top:10px;width:100%;border-top:1px solid #bbb;}@media(max-width:500px) {div.ch .unit, div.ch-iv .unit {font-size:18px;}div.ch {width:170px;min-height:100px }.subgrp {width:180px;}}"; |
|||
const uint32_t style_css_len = 2899; |
|||
#endif /*__STYLE_CSS_H__*/ |
@ -1,5 +0,0 @@ |
|||
#ifndef __VISUALIZATION_HTML_H__ |
|||
#define __VISUALIZATION_HTML_H__ |
|||
const char visualization_html[] PROGMEM = "<!doctype html><html><head><title>Index - {DEVICE}</title><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><script type=\"text/javascript\">getAjax('/livedata', 'livedata');window.setInterval(\"getAjax('/livedata', 'livedata')\", {JS_TS});function getAjax(url, resid) {var http = null;http = new XMLHttpRequest();if(http != null) {http.open(\"GET\", url, true);http.onreadystatechange = print;http.send(null);}function print() {if(http.readyState == 4) {document.getElementById(resid).innerHTML = http.responseText;}}}</script><style type=\"text/css\"></style></head><body><h1>AHOY - {DEVICE}</h1><div id=\"content\" class=\"content\"><div id=\"livedata\"></div><p>Every {TS}seconds the values are updated</p></div><div id=\"footer\"><p class=\"left\">© 2022</p><p class=\"left\"><a href=\"/\">Home</a></p><p class=\"right\">AHOY :: {VERSION}</p></div></body></html>"; |
|||
const uint32_t visualization_html_len = 922; |
|||
#endif /*__VISUALIZATION_HTML_H__*/ |
Loading…
Reference in new issue