firmware - some html cosmetics

This commit is contained in:
DeltaLima 2024-12-10 23:50:23 +01:00
parent ffaf4e7b82
commit ebfd33af0c

View file

@ -220,10 +220,14 @@ void SysMaintenance() {
MaintenanceMode = false;
body += "<div class='infomsg'>&#9208;&#65039; Dimm LED Off</div>";
} else if(webserver.hasArg("PumpOnManual")) {
if(UsePump == true) {
PumpOnManual = true;
body += "<div class='infomsg'>&#x1F4A7; Pump manual activated for ";
body += PumpOnTime;
body += "s</div>";
} else {
body += "<div class='warnmsg'>&#x1F4A7; Pump mode is set to <b>Off</b> in &#9881; System settings</div>";
}
}
@ -467,15 +471,16 @@ void WEBgrowSettings() {
body+= "' required><br>\n";
// the input field, which calls javascript convertDateToEpoch() to write data to transmit to id GrowStart
body += "Grow start date: <input type='date' id='GrowStart_sel' onChange='convertDateToEpoch(\"GrowStart_sel\", \"GrowStart\");' value='";
body += returnStrDateFromEpoch(GrowStart);
body += "' required><br>\n";
body += "<input type='hidden' id='GrowStart' name='GrowStart' value='";
body += GrowStart;
body+= "' required>\n";
// the input field, which calls javascript convertDateToEpoch() to write data to transmit to id GrowStart
body += "Grow start date: <input type='date' id='GrowStart_sel' onChange='convertDateToEpoch(\"GrowStart_sel\", \"GrowStart\");' value='";
body += returnStrDateFromEpoch(GrowStart);
body += "' required><br><br>\n";
body += "Vegetation duration: <input class='inputShort' type='number' name='DaysVeg' min='0' max='255' value='";
@ -484,7 +489,9 @@ void WEBgrowSettings() {
body += "Bloom duration: <input class='inputShort' type='number' name='DaysBloom' min='0' max='255' value='";
body += DaysBloom;
body+= "' required> days<br>\n";
body+= "' required> days<br><br>\n";
body += "Time LED ON vegetation: <input class='inputShort' type='number' name='LighthoursVeg' min='0' max='255' value='";
body += LighthoursVeg;
@ -492,7 +499,9 @@ void WEBgrowSettings() {
body += "Time LED ON bloom: <input class='inputShort' type='number' name='LighthoursBloom' min='0' max='255' value='";
body += LighthoursBloom;
body+= "' required> hours<br>\n";
body+= "' required> hours<br><br>\n";
body += "Sunrise: <input class='inputShort' type='number' name='SunriseHour' min='0' max='23' value='";
body += SunriseHour;
@ -509,7 +518,7 @@ void WEBgrowSettings() {
body += "Fade duration: <input class='inputShort' type='number' name='SunFadeDuration' min='1' max='255' value='";
body += SunFadeDuration;
body+= "' required> Minutes<br>\n";
body+= "' required> Minutes<br><br>\n";
if(UseLEDrelais == false) {
body += "LED brightness: <input type='range' id='PinLEDPWM' name='PinLEDPWM' min='0' max='255' value='";
@ -535,7 +544,7 @@ void WEBgrowSettings() {
body += "FAN2 speed: <input type='range' id='PinFAN2PWM' name='PinFAN2PWM' min='0' max='255' value='";
body += PinFAN2PWM;
body += "'/> %<br>\n";
body += "'/> %<br><br>\n";
body += "Pump interval vegetation: every <input class='inputShort' type='number' name='PumpIntervalVeg' min='0' max='255' value='";
@ -603,23 +612,14 @@ void WEBsystemSettings() {
body += "</select><br>\n";
*/
body += "<b>Output configuration</b><br>";
// OutputInvert bool
body += "Invert Outputs: <select id='OutputInvert' name='OutputInvert' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='1'" + returnStrSelected(OutputInvert, 1) + ">Yes</option>\n";
body += "<option value='0'" + returnStrSelected(OutputInvert, 0) + ">No</option>\n";
body += "</select><br>\n";
// PumpMode byte
body += "Pump mode: <select id='UsePump' name='UsePump' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='0'" + returnStrSelected(UsePump, 0) + ">Off</option>\n";
body += "<option value='1'" + returnStrSelected(UsePump, 1) + ">1</option>\n";
body += "<option value='2'" + returnStrSelected(UsePump, 2) + ">2</option>\n";
body += "<option value='3'" + returnStrSelected(UsePump, 3) + ">3</option>\n";
body += "</select><br><p class='helpbox'><b>1:</b> Water every few days.<br> \
<b>2:</b> Water if the soil moisture falls below <i>Soilmoisture low</i> value<br> \
<b>3:</b> Water every few days if the soil moisture falls below <i>Soilmoisture low</i> value.</p>\n";
body += "<p class='helpbox'>When using CanGrow PCB v0.6, set to <b>Yes</b></p>\n";
// UseLEDrelais bool
body += "Use relais for LED (disable PWM): <select id='UseLEDrelais' name='UseLEDrelais' required>\n";
@ -633,13 +633,12 @@ void WEBsystemSettings() {
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='1'" + returnStrSelected(UseFANrelais, 1) + ">Yes</option>\n";
body += "<option value='0'" + returnStrSelected(UseFANrelais, 0) + ">No</option>\n";
body += "</select><br>\n";
body += "</select><br><br>\n";
// TODO ugly. can this done be better?
// PumpOnTime int
body += "Pump ON time: <input class='inputShort' type='number' name='PumpOnTime' min='0' max='255' value='";
body += PumpOnTime;
body += "' required> Seconds<br>\n";
body += "<b>Sensor configuration</b><br>";
// MoistureSensor_Type byte
body += "Soilmoisture sensor: <select id='SelMoistureSensor_Type' name='MoistureSensor_Type' onchange='MoistureSensorType();' required>\n";
@ -650,18 +649,6 @@ void WEBsystemSettings() {
body += "<option value='2'" + returnStrSelected(MoistureSensor_Type, 2) + ">I2C Chirp (0x20)</option>\n";
body += "</select><br>\n";
// SoilmoistureLow byte
body += "Soilmoisture low: <input class='inputShort' type='number' name='SoilmoistureLow' min='0' value='";
body += SoilmoistureLow;
body += "' required> %<br>\n";
// SoilmoistureWet byte
body += "Soilmoisture wet: <input type='number' id='iSoilmoistureWet' name='SoilmoistureWet' min='0' value='";
body += SoilmoistureWet;
body += "' required>\n";
body += "<p class='helpbox'><b>Analog capacitive:</b> <i>160</i><br> \
<b>I2C Chirp:</b> <i>485</i></p>";
// SoilmoistureDry byte
body += "Soilmoisture dry: <input type='number' id='iSoilmoistureDry' name='SoilmoistureDry' min='0' value='";
body += SoilmoistureDry;
@ -669,6 +656,12 @@ void WEBsystemSettings() {
body += "<p class='helpbox'><b>Analog capacitive:</b> <i>360</i><br> \
<b>I2C Chirp:</b> <i>250</i></p>";
// SoilmoistureWet byte
body += "Soilmoisture wet: <input type='number' id='iSoilmoistureWet' name='SoilmoistureWet' min='0' value='";
body += SoilmoistureWet;
body += "' required>\n";
body += "<p class='helpbox'><b>Analog capacitive:</b> <i>160</i><br> \
<b>I2C Chirp:</b> <i>485</i></p>";
// MoistureSensor_Type Javascript
body += FPSTR(JSsoilmoistureTypeSelect);
@ -695,7 +688,36 @@ void WEBsystemSettings() {
body += "<option value='2'" + returnStrSelected(HumiditySensor_Type, 2) + ">I2C BME280 (0x77)</option>\n";
body += "<option value='3'" + returnStrSelected(HumiditySensor_Type, 3) + ">I2C SHT31 (0x44)</option>\n";
body += "<option value='4'" + returnStrSelected(HumiditySensor_Type, 4) + ">I2C SHT31 (0x45)</option>\n";
body += "</select><br>\n";
body += "</select><br><br>\n";
body += "<b>Pump configuration</b><br>";
// PumpMode byte
body += "Pump mode: <select id='UsePump' name='UsePump' required>\n";
if(configured == false){body += "<option disabled value='' selected hidden>---</option>\n";}
body += "<option value='0'" + returnStrSelected(UsePump, 0) + ">Off</option>\n";
body += "<option value='1'" + returnStrSelected(UsePump, 1) + ">1</option>\n";
body += "<option value='2'" + returnStrSelected(UsePump, 2) + ">2</option>\n";
body += "<option value='3'" + returnStrSelected(UsePump, 3) + ">3</option>\n";
body += "</select><br><p class='helpbox'><b>1:</b> Water every few days.<br> \
<b>2:</b> Water if the soil moisture falls below <i>Soilmoisture low</i> value<br> \
<b>3:</b> Water every few days if the soil moisture falls below <i>Soilmoisture low</i> value.</p>\n";
// TODO ugly. can this done be better?
// PumpOnTime int
body += "Pump ON time: <input class='inputShort' type='number' name='PumpOnTime' min='0' max='255' value='";
body += PumpOnTime;
body += "' required> Seconds<br>\n";
// SoilmoistureLow byte
body += "Soilmoisture low: <input class='inputShort' type='number' name='SoilmoistureLow' min='0' value='";
body += SoilmoistureLow;
body += "' required> %<br><br>\n";
body += "<b>General configuration</b><br>";
// NtpOffset int
body += "NTP offset: <input class='inputShort' type='number' name='NtpOffset' min='-12' max='14' value='";