mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-21 22:50:55 +00:00
#63 Add variables for jsonDynamicDocument Sizes
This commit is contained in:
parent
0323920a0d
commit
fe45ed8010
@ -1,4 +1,4 @@
|
||||
# ESPUI
|
||||
# ESPUI 2.0
|
||||
|
||||
![ESPUI](https://github.com/s00500/ESPUI/blob/master/docs/ui_complete.png) //
|
||||
TODO: Update Logo
|
||||
|
@ -480,7 +480,7 @@ void ESPUIClass::updateControl(Control *control, int clientId) {
|
||||
}
|
||||
|
||||
String json;
|
||||
DynamicJsonDocument document(2000);
|
||||
DynamicJsonDocument document(jsonUpdateDocumentSize);
|
||||
JsonObject root = document.to<JsonObject>();
|
||||
|
||||
root["type"] = (int)control->type + ControlType::UpdateOffset;
|
||||
@ -578,7 +578,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId) {
|
||||
}
|
||||
|
||||
String json;
|
||||
DynamicJsonDocument document(2000);
|
||||
DynamicJsonDocument document(jsonUpdateDocumentSize);
|
||||
JsonObject root = document.to<JsonObject>();
|
||||
|
||||
root["type"] = (int)ControlType::GraphPoint;
|
||||
@ -622,7 +622,7 @@ sent as one blob at the beginning. Therefore a new type is used as well
|
||||
*/
|
||||
void ESPUIClass::jsonDom(AsyncWebSocketClient *client) {
|
||||
String json;
|
||||
DynamicJsonDocument document(4000);
|
||||
DynamicJsonDocument document(jsonInitialDocumentSize);
|
||||
document["type"] = (int)UI_INITIAL_GUI;
|
||||
JsonArray items = document.createNestedArray("controls");
|
||||
|
||||
|
@ -166,7 +166,11 @@ enum Verbosity : uint8_t { Quiet = 0, Verbose, VerboseJSON };
|
||||
|
||||
class ESPUIClass {
|
||||
public:
|
||||
ESPUIClass() { verbosity = Verbosity::Quiet; }
|
||||
ESPUIClass() {
|
||||
verbosity = Verbosity::Quiet;
|
||||
jsonUpdateDocumentSize = 2000;
|
||||
jsonInitialDocumentSize = 8000;
|
||||
}
|
||||
void setVerbosity(Verbosity verbosity);
|
||||
void begin(const char *_title, const char *username = nullptr, const char *password = nullptr); // Setup server and page in Memorymode
|
||||
void beginSPIFFS(const char *_title, const char *username = nullptr, const char *password = nullptr); // Setup server and page in SPIFFSmode
|
||||
|
Loading…
Reference in New Issue
Block a user