mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-15 23:45:13 +02:00
added wifi scan to setup
fixed issues on index.html
This commit is contained in:
parent
8b8deded9a
commit
dbbfe25a44
10 changed files with 91 additions and 17 deletions
|
@ -45,16 +45,17 @@ void webApi::onApi(AsyncWebServerRequest *request) {
|
|||
|
||||
Inverter<> *iv = mApp->mSys->getInverterByPos(0, false);
|
||||
String path = request->url().substring(5);
|
||||
if(path == "system") getSystem(root);
|
||||
else if(path == "statistics") getStatistics(root);
|
||||
else if(path == "inverter/list") getInverterList(root);
|
||||
else if(path == "index") getIndex(root);
|
||||
else if(path == "setup") getSetup(root);
|
||||
else if(path == "live") getLive(root);
|
||||
else if(path == "record/info") getRecord(root, iv->getRecordStruct(InverterDevInform_All));
|
||||
else if(path == "record/alarm") getRecord(root, iv->getRecordStruct(AlarmData));
|
||||
else if(path == "record/config") getRecord(root, iv->getRecordStruct(SystemConfigPara));
|
||||
else if(path == "record/live") getRecord(root, iv->getRecordStruct(RealTimeRunData_Debug));
|
||||
if(path == "system") getSystem(root);
|
||||
else if(path == "statistics") getStatistics(root);
|
||||
else if(path == "inverter/list") getInverterList(root);
|
||||
else if(path == "index") getIndex(root);
|
||||
else if(path == "setup") getSetup(root);
|
||||
else if(path == "setup/networks") getNetworks(root);
|
||||
else if(path == "live") getLive(root);
|
||||
else if(path == "record/info") getRecord(root, iv->getRecordStruct(InverterDevInform_All));
|
||||
else if(path == "record/alarm") getRecord(root, iv->getRecordStruct(AlarmData));
|
||||
else if(path == "record/config") getRecord(root, iv->getRecordStruct(SystemConfigPara));
|
||||
else if(path == "record/live") getRecord(root, iv->getRecordStruct(RealTimeRunData_Debug));
|
||||
else
|
||||
getNotFound(root, F("http://") + request->host() + F("/api/"));
|
||||
|
||||
|
@ -291,6 +292,12 @@ void webApi::getSetup(JsonObject obj) {
|
|||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void webApi::getNetworks(JsonObject obj) {
|
||||
mApp->getAvailNetworks(obj);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void webApi::getLive(JsonObject obj) {
|
||||
getSystem(obj.createNestedObject(F("system")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue