35 lines
847 B
C++
35 lines
847 B
C++
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include <ESP8266WebServer.h>
|
|
#include "config/ConfigManager.h"
|
|
#include "motor/StepperController.h"
|
|
#include "network/NetworkManager.h"
|
|
#include "ota/OtaManager.h"
|
|
|
|
class WebServerManager {
|
|
public:
|
|
WebServerManager(ConfigManager& config, StepperController& motor, NetworkManager& network, OtaManager& ota);
|
|
void begin();
|
|
void update();
|
|
|
|
private:
|
|
void registerRoutes();
|
|
void handleRoot();
|
|
void handleConfigPage();
|
|
void handleStatus();
|
|
void handleCommand();
|
|
void handleConfigGet();
|
|
void handleConfigPost();
|
|
void handleFactoryReset();
|
|
void handleNotFound();
|
|
String renderPage() const;
|
|
bool parseFloatArg(const String& name, float& value) const;
|
|
|
|
ESP8266WebServer server_{80};
|
|
ConfigManager& config_;
|
|
StepperController& motor_;
|
|
NetworkManager& network_;
|
|
OtaManager& ota_;
|
|
};
|