|
@ -45,16 +45,17 @@ void webApi::onApi(AsyncWebServerRequest *request) { |
|
|
|
|
|
|
|
|
Inverter<> *iv = mApp->mSys->getInverterByPos(0, false); |
|
|
Inverter<> *iv = mApp->mSys->getInverterByPos(0, false); |
|
|
String path = request->url().substring(5); |
|
|
String path = request->url().substring(5); |
|
|
if(path == "system") getSystem(root); |
|
|
if(path == "system") getSystem(root); |
|
|
else if(path == "statistics") getStatistics(root); |
|
|
else if(path == "statistics") getStatistics(root); |
|
|
else if(path == "inverter/list") getInverterList(root); |
|
|
else if(path == "inverter/list") getInverterList(root); |
|
|
else if(path == "index") getIndex(root); |
|
|
else if(path == "index") getIndex(root); |
|
|
else if(path == "setup") getSetup(root); |
|
|
else if(path == "setup") getSetup(root); |
|
|
else if(path == "live") getLive(root); |
|
|
else if(path == "setup/networks") getNetworks(root); |
|
|
else if(path == "record/info") getRecord(root, iv->getRecordStruct(InverterDevInform_All)); |
|
|
else if(path == "live") getLive(root); |
|
|
else if(path == "record/alarm") getRecord(root, iv->getRecordStruct(AlarmData)); |
|
|
else if(path == "record/info") getRecord(root, iv->getRecordStruct(InverterDevInform_All)); |
|
|
else if(path == "record/config") getRecord(root, iv->getRecordStruct(SystemConfigPara)); |
|
|
else if(path == "record/alarm") getRecord(root, iv->getRecordStruct(AlarmData)); |
|
|
else if(path == "record/live") getRecord(root, iv->getRecordStruct(RealTimeRunData_Debug)); |
|
|
else if(path == "record/config") getRecord(root, iv->getRecordStruct(SystemConfigPara)); |
|
|
|
|
|
else if(path == "record/live") getRecord(root, iv->getRecordStruct(RealTimeRunData_Debug)); |
|
|
else |
|
|
else |
|
|
getNotFound(root, F("http://") + request->host() + F("/api/")); |
|
|
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) { |
|
|
void webApi::getLive(JsonObject obj) { |
|
|
getSystem(obj.createNestedObject(F("system"))); |
|
|
getSystem(obj.createNestedObject(F("system"))); |
|
|