Enhancement: Rework Web Page handling, get them as static as possible #13

Open
opened 2024-07-28 02:40:56 +02:00 by DeltaLima · 0 comments
Owner

Current page handling is a nightmare

    String body = returnHTMLheader("growSettings");
    
    if(strlen(GrowName) < 1) {
      body += "<h1>Final step: Grow settings</h1>";
      body += "<p>Please configure all settings<br>";
      body += "</p>";
      GrowStart = timeClient.getEpochTime();
    }
    
    body += "<h2>&#128262; Grow settings</h2>";
    if(webserver.hasArg("success")) {
      body += FPSTR(HTMLsuccess);
    } 
    body += "<p>Here you can set everything grow related, like light hours, how much water, LED brightness<br>";
    body += "</p>";
    
    body += "<form method='post' action='/growSettings/save'>\n";
    
  

I would like to store the basic html page in LittleFS and do all the dynamic things with javascript. WLED and Tasmota have good examples for this

Current page handling is a nightmare ``` String body = returnHTMLheader("growSettings"); if(strlen(GrowName) < 1) { body += "<h1>Final step: Grow settings</h1>"; body += "<p>Please configure all settings<br>"; body += "</p>"; GrowStart = timeClient.getEpochTime(); } body += "<h2>&#128262; Grow settings</h2>"; if(webserver.hasArg("success")) { body += FPSTR(HTMLsuccess); } body += "<p>Here you can set everything grow related, like light hours, how much water, LED brightness<br>"; body += "</p>"; body += "<form method='post' action='/growSettings/save'>\n"; ``` I would like to store the basic html page in LittleFS and do all the dynamic things with javascript. WLED and Tasmota have good examples for this
DeltaLima added this to the v0.2 Rewrite project 2024-09-16 00:25:23 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DeltaLima/CanGrow#13
No description provided.