mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
37 lines
956 B
C++
37 lines
956 B
C++
#ifndef WebStatusService_h
|
|
#define WebStatusService_h
|
|
|
|
#define EMSESP_SYSTEM_STATUS_SERVICE_PATH "/rest/systemStatus"
|
|
#define EMSESP_ACTION_SERVICE_PATH "/rest/action"
|
|
|
|
#include <semver200.h> // for version checking
|
|
|
|
namespace emsesp {
|
|
|
|
class WebStatusService {
|
|
public:
|
|
WebStatusService(AsyncWebServer * server, SecurityManager * securityManager);
|
|
|
|
// make action function public so we can test in the debug and standalone mode
|
|
#ifndef EMSESP_STANDALONE
|
|
protected:
|
|
#endif
|
|
void systemStatus(AsyncWebServerRequest * request);
|
|
void action(AsyncWebServerRequest * request, JsonVariant json);
|
|
|
|
private:
|
|
SecurityManager * _securityManager;
|
|
|
|
// actions
|
|
bool checkUpgrade(JsonObject root, std::string & latest_version);
|
|
bool exportData(JsonObject root, std::string & type);
|
|
bool getCustomSupport(JsonObject root);
|
|
bool uploadURL(const char * url);
|
|
|
|
void allvalues(JsonObject output);
|
|
};
|
|
|
|
} // namespace emsesp
|
|
|
|
#endif
|