added headers for setup page

This commit is contained in:
Yurii
2023-12-10 01:26:14 +03:00
parent 1f81ec1ba5
commit dce94b0f98
2 changed files with 73 additions and 28 deletions

View File

@@ -0,0 +1,27 @@
#pragma once
#include <WiFiManager.h>
class HeaderParameter : public WiFiManagerParameter {
public:
HeaderParameter(const char* title) {
WiFiManagerParameter("");
byte size = strlen(title) + strlen(this->tpl) + 1;
this->buffer = new char[size];
this->title = title;
}
~HeaderParameter() {
delete[] this->buffer;
}
const char* getCustomHTML() const override {
sprintf(this->buffer, this->tpl, title);
return this->buffer;
}
protected:
const char* title;
char* buffer;
const char* tpl = "<div class=\"bheader\">%s</div>";
};