css fixes
This commit is contained in:
parent
1927449c1d
commit
0f77ac163a
@ -1,11 +1,11 @@
|
|||||||
//offer ota and config mode
|
//offer ota and config mode
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io::{BufRead, BufReader, Read, Write},
|
|
||||||
str::from_utf8,
|
str::from_utf8,
|
||||||
sync::{atomic::AtomicBool, Arc},
|
sync::{atomic::AtomicBool, Arc},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use esp_idf_svc::io::BufRead;
|
||||||
use crate::{
|
use crate::{
|
||||||
espota::OtaUpdate, get_version, map_range_moisture, plant_hal::FileInfo, BOARD_ACCESS,
|
espota::OtaUpdate, get_version, map_range_moisture, plant_hal::FileInfo, BOARD_ACCESS,
|
||||||
};
|
};
|
||||||
@ -242,7 +242,7 @@ fn flash_bq(filename: &str, dryrun: bool) -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let file_handle = board.get_file_handle(filename, false)?;
|
let file_handle = board.get_file_handle(filename, false)?;
|
||||||
|
|
||||||
let mut reader = BufReader::with_capacity(512, file_handle).lines();
|
let mut reader = std::io::BufRead::lines(std::io::BufReader::with_capacity(512, file_handle));
|
||||||
let mut line = 0;
|
let mut line = 0;
|
||||||
loop {
|
loop {
|
||||||
board.general_fault(toggle);
|
board.general_fault(toggle);
|
||||||
@ -373,7 +373,7 @@ pub fn httpd(_reboot_now: Arc<AtomicBool>) -> Box<EspHttpServer<'static>> {
|
|||||||
let mut buffer: [u8; BUFFER_SIZE] = [0; BUFFER_SIZE];
|
let mut buffer: [u8; BUFFER_SIZE] = [0; BUFFER_SIZE];
|
||||||
let mut total_read: usize = 0;
|
let mut total_read: usize = 0;
|
||||||
loop {
|
loop {
|
||||||
let read = file_handle.read(&mut buffer)?;
|
let read = std::io::Read::read(&mut file_handle, &mut buffer)?;
|
||||||
total_read += read;
|
total_read += read;
|
||||||
println!(
|
println!(
|
||||||
"sending {read} bytes of {total_read} for file {}",
|
"sending {read} bytes of {total_read} for file {}",
|
||||||
@ -416,7 +416,7 @@ pub fn httpd(_reboot_now: Arc<AtomicBool>) -> Box<EspHttpServer<'static>> {
|
|||||||
total_read += read;
|
total_read += read;
|
||||||
println!("sending {read} bytes of {total_read} for upload {filename}");
|
println!("sending {read} bytes of {total_read} for upload {filename}");
|
||||||
let to_write = &buffer[0..read];
|
let to_write = &buffer[0..read];
|
||||||
file_handle.write(to_write)?;
|
std::io::Write::write(&mut file_handle, to_write)?;
|
||||||
println!("wrote {read} bytes of {total_read} for upload {filename}");
|
println!("wrote {read} bytes of {total_read} for upload {filename}");
|
||||||
if read == 0 {
|
if read == 0 {
|
||||||
break;
|
break;
|
||||||
@ -508,9 +508,12 @@ pub fn httpd(_reboot_now: Arc<AtomicBool>) -> Box<EspHttpServer<'static>> {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
server
|
server
|
||||||
.fn_handler("/bootstrap-grid.css", Method::Get, |request| {
|
.fn_handler("/bootstrap-grid.css", Method::Get, |request| {
|
||||||
request
|
let headers = [
|
||||||
.into_ok_response()?
|
("Access-Control-Allow-Origin", "*"),
|
||||||
.write(include_bytes!("bootstrap-grid.css"))?;
|
("Access-Control-Allow-Headers", "*"),
|
||||||
|
("Content-Type", "text/css")
|
||||||
|
];
|
||||||
|
request.into_response(200, None, &headers)?.write(include_bytes!("bootstrap-grid.css"))?;
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1,46 +1,42 @@
|
|||||||
<div class="container col-sm-6 col-md-5" style="border-style: solid; border-width: 1px; padding: 8px; margin: 8px;" >
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col-12" style="text-align: center; font-weight: bold;">
|
||||||
<div class="col-7">
|
Battery:
|
||||||
</div>
|
</div>
|
||||||
<div class="col-7" style="text-align: center; font-weight: bold;">
|
<div style="display: block; right: 8px; position: absolute;">
|
||||||
Time:
|
<input id="battery_auto_refresh" type="checkbox">⟳
|
||||||
</div>
|
|
||||||
<div style="display: block; right: 8px; position: absolute;">
|
|
||||||
<input id="battery_auto_refresh" type="checkbox">⟳
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
</div>
|
||||||
<span class="col-7">V:</span>
|
|
||||||
<div class="col-5" id="battery_voltage_milli_volt" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">V:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_voltage_milli_volt" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">mA:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_current_milli_ampere" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">mA:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_current_milli_ampere" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">Cycles:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_cycle_count" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">Cycles:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_cycle_count" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">design mA:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_design_milli_ampere" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">design mA:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_design_milli_ampere" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">remaining mA:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_remaining_milli_ampere" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">remaining mA:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_remaining_milli_ampere" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">charge %:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_state_of_charge" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">charge %:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_state_of_charge" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">health %:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_state_of_health" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">health %:</span>
|
||||||
<div class="row">
|
<div class="col-5" id="battery_state_of_health" style="text-wrap: nowrap"></div>
|
||||||
<span class="col-7">Temp °C:</span>
|
</div>
|
||||||
<div class="col-5" id="battery_temperature" style="text-wrap: nowrap"></div>
|
<div class="row">
|
||||||
</div>
|
<span class="col-7">Temp °C:</span>
|
||||||
|
<div class="col-5" id="battery_temperature" style="text-wrap: nowrap"></div>
|
||||||
</div>
|
</div>
|
@ -1,113 +1,116 @@
|
|||||||
<link rel="stylesheet" href="bootstrap-grid.css">
|
<link rel="stylesheet" href="bootstrap-grid.css">
|
||||||
<style>
|
<style>
|
||||||
.progressPane{
|
.progressPane {
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background-color: lightgrey;
|
background-color: lightgrey;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
.progressPaneCenter{
|
|
||||||
display: inline-block;
|
.progressPaneCenter {
|
||||||
margin-top: 48%;
|
display: inline-block;
|
||||||
position: absolute;
|
margin-top: 48%;
|
||||||
height: 4%;
|
position: absolute;
|
||||||
width: 50%;
|
height: 4%;
|
||||||
margin-left: 25%;
|
width: 50%;
|
||||||
margin-right: 25%;
|
margin-left: 25%;
|
||||||
}
|
margin-right: 25%;
|
||||||
.progress {
|
}
|
||||||
height: 1.5em;
|
|
||||||
width: 100%;
|
.progress {
|
||||||
background-color: #c9c9c9;
|
height: 1.5em;
|
||||||
position: relative;
|
width: 100%;
|
||||||
}
|
background-color: #c9c9c9;
|
||||||
.progress:after {
|
position: relative;
|
||||||
content: attr(data-label);
|
}
|
||||||
font-size: 0.8em;
|
|
||||||
position: absolute;
|
.progress:after {
|
||||||
text-align: center;
|
content: attr(data-label);
|
||||||
top: 5px;
|
font-size: 0.8em;
|
||||||
left: 0;
|
position: absolute;
|
||||||
right: 0;
|
text-align: center;
|
||||||
}
|
top: 5px;
|
||||||
.progress .value {
|
left: 0;
|
||||||
background-color: #7cc4ff;
|
right: 0;
|
||||||
display: inline-block;
|
}
|
||||||
height: 100%;
|
|
||||||
|
.progress .value {
|
||||||
|
background-color: #7cc4ff;
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress .valueIndeterminate {
|
||||||
|
background-color: #7cc4ff;
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
animation: indeterminateAnimation 1s infinite linear;
|
||||||
|
transform-origin: 0% 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes indeterminateAnimation {
|
||||||
|
0% {
|
||||||
|
transform: translateX(0%) scaleX(0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress .valueIndeterminate {
|
50% {
|
||||||
background-color: #7cc4ff;
|
transform: translateX(50%) scaleX(0.5);
|
||||||
display: inline-block;
|
|
||||||
height: 100%;
|
|
||||||
animation: indeterminateAnimation 1s infinite linear;
|
|
||||||
transform-origin: 0% 50%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
@keyframes indeterminateAnimation {
|
transform: translateX(0%) scaleX(0.5);
|
||||||
0% {
|
|
||||||
transform: translateX(0%) scaleX(0.5);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
transform: translateX(50%) scaleX(0.5);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: translateX(0%) scaleX(0.5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container-xxl">
|
<div class="container-xl">
|
||||||
<input type="button" id="test" value="Test">
|
<div class="row">
|
||||||
|
<div id="firmwareview" class="container col-12 col-lg-4"
|
||||||
<div id="firmwareview">
|
style="border-width: 1px; border-style: solid; padding: 8px;">
|
||||||
|
</div>
|
||||||
|
<div id="timeview" class="container col-12 col-lg-4" style="border-style: solid; border-width: 1px; padding: 8px;">
|
||||||
|
</div>
|
||||||
|
<div id="batteryview" class="container col-12 col-lg-4"
|
||||||
|
style="border-style: solid; border-width: 1px; padding: 8px;">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="timeview">
|
<div class="row">
|
||||||
|
<div id="network_view" class="container col-12 col-sm-6 col-lg-4"
|
||||||
|
style="border-style: solid; border-width: 1px; padding: 8px;">
|
||||||
|
</div>
|
||||||
|
<div id="lightview" class="container col-12 col-sm-6 col-lg-4"
|
||||||
|
style="border-style: solid; border-width: 1px; padding: 16px;">
|
||||||
|
</div>
|
||||||
|
<div id="tankview" class="container col-12 col-lg-4" style="border-style: solid; border-width: 1px; padding: 16px;">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="network_view">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="tankview"></div>
|
|
||||||
<div id="batteryview"></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>config</h2>
|
<h2>config</h2>
|
||||||
|
<h3>Plants:</h3>
|
||||||
<div id="configform">
|
<button id="measure_moisture">Measure Moisture</button>
|
||||||
|
<div id="plants" class="row"></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Light:</h3>
|
|
||||||
<input type="checkbox" id="night_lamp_enabled" checked="false"> Enable Nightlight
|
|
||||||
<div>
|
|
||||||
Start
|
|
||||||
<select type="time" id="night_lamp_time_start">
|
|
||||||
</select>
|
|
||||||
Stop
|
|
||||||
<select type="time" id="night_lamp_time_end">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input type="checkbox" id="night_lamp_only_when_dark">
|
|
||||||
Light only when dark
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Plants:</h3>
|
|
||||||
<button id="measure_moisture">Measure Moisture</button>
|
|
||||||
<div id="plants" class="row"></div>
|
|
||||||
</div>
|
|
||||||
<button id="submit">Submit</button>
|
<button id="submit">Submit</button>
|
||||||
<div id="submit_status"></div>
|
<div id="submit_status"></div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -8,7 +8,7 @@ document.body.innerHTML = require('./main.html') as string;
|
|||||||
import { TimeView } from "./timeview";
|
import { TimeView } from "./timeview";
|
||||||
import { PlantView, PlantViews } from "./plant";
|
import { PlantView, PlantViews } from "./plant";
|
||||||
import { NetworkConfigView } from "./network";
|
import { NetworkConfigView } from "./network";
|
||||||
import { NightLampView } from "./nightmode";
|
import { NightLampView } from "./nightlightview";
|
||||||
import { TankConfigView } from "./tankview";
|
import { TankConfigView } from "./tankview";
|
||||||
import { SubmitView } from "./submitView";
|
import { SubmitView } from "./submitView";
|
||||||
import { ProgressView } from "./progress";
|
import { ProgressView } from "./progress";
|
||||||
@ -256,6 +256,6 @@ const controller = new Controller();
|
|||||||
controller.updateRTCData();
|
controller.updateRTCData();
|
||||||
controller.updateBatteryData();
|
controller.updateBatteryData();
|
||||||
controller.downloadConfig();
|
controller.downloadConfig();
|
||||||
n controller.measure_moisture();
|
//controller.measure_moisture();
|
||||||
controller.version();
|
controller.version();
|
||||||
|
|
||||||
|
14
rust/src_webpack/src/nightlightview.html
Normal file
14
rust/src_webpack/src/nightlightview.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<h3>Light:</h3>
|
||||||
|
<input type="checkbox" id="night_lamp_enabled" checked="false"> Enable Nightlight
|
||||||
|
<div>
|
||||||
|
Start
|
||||||
|
<select type="time" id="night_lamp_time_start">
|
||||||
|
</select>
|
||||||
|
Stop
|
||||||
|
<select type="time" id="night_lamp_time_end">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" id="night_lamp_only_when_dark">
|
||||||
|
Light only when dark
|
||||||
|
</div>
|
@ -5,6 +5,9 @@ export class NightLampView {
|
|||||||
private readonly night_lamp_time_start: HTMLSelectElement;
|
private readonly night_lamp_time_start: HTMLSelectElement;
|
||||||
private readonly night_lamp_time_end: HTMLSelectElement;
|
private readonly night_lamp_time_end: HTMLSelectElement;
|
||||||
constructor(controller:Controller){
|
constructor(controller:Controller){
|
||||||
|
(document.getElementById("lightview") as HTMLElement).innerHTML = require('./nightlightview.html') as string;
|
||||||
|
|
||||||
|
|
||||||
this.night_lamp_only_when_dark = document.getElementById("night_lamp_only_when_dark") as HTMLInputElement;
|
this.night_lamp_only_when_dark = document.getElementById("night_lamp_only_when_dark") as HTMLInputElement;
|
||||||
this.night_lamp_only_when_dark.onchange = controller.configChanged
|
this.night_lamp_only_when_dark.onchange = controller.configChanged
|
||||||
this.night_lamp_time_start = document.getElementById("night_lamp_time_start") as HTMLSelectElement;
|
this.night_lamp_time_start = document.getElementById("night_lamp_time_start") as HTMLSelectElement;
|
@ -1,22 +1,25 @@
|
|||||||
<div class="container col-12 col-sm-7 col-md-7" style="border-width: 1px; border-style: solid; padding: 8px; margin: 8px;">
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col-12" style="text-align: center; font-weight: bold;">
|
||||||
<div class="col-12" style="text-align: center; font-weight: bold;">
|
Current Firmware
|
||||||
Current Firmware
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<span>Buildtime:</span>
|
|
||||||
<span id="firmware_buildtime" style="text-wrap: nowrap"></span>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<span>Buildhash:</span>
|
|
||||||
<span id="firmware_githash" style="text-wrap: nowrap"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<form class="col-12" id="upload_form" method="post">
|
|
||||||
<input type="file" name="file1" id="firmware_file"><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<span>Buildtime:</span>
|
||||||
|
<span id="firmware_buildtime" style="text-wrap: nowrap"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<span>Buildhash:</span>
|
||||||
|
<span id="firmware_githash" style="text-wrap: nowrap"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<form class="col-12" id="upload_form" method="post">
|
||||||
|
<input type="file" name="file1" id="firmware_file"><br>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<input style="margin-left: 16px; margin-top: 8px;" class="col-6" type="button" id="test" value="Self-Test">
|
||||||
|
</div>
|
@ -1,31 +1,32 @@
|
|||||||
<div class="container" style="border-style: solid; border-width: 1px; margin: 8px; padding: 8px;">
|
<div class="container" style="border-style: solid; border-width: 1px; padding: 8px;">
|
||||||
<span class="row col-12" style="font-weight: bold; display: block; text-align: center;" id="plant_${plantId}_header">Plant ${plantId}</span>
|
<span class="row col-12" style="font-weight: bold; display: block; text-align: center;"
|
||||||
|
id="plant_${plantId}_header">Plant ${plantId}</span>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-1"></div>
|
<div class="col-1"></div>
|
||||||
<button class="col-10" id="plant_${plantId}_test">Test</button>
|
<button class="col-10" id="plant_${plantId}_test">Test</button>
|
||||||
<div class="col-1"></div>
|
<div class="col-1"></div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12">Live:</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-7">Sensor A:</div>
|
|
||||||
<span class="col-4" id="plant_${plantId}_moisture_a">loading</span>
|
|
||||||
<div class="col-7">Sensor B:</div>
|
|
||||||
<span class="col-4" id="plant_${plantId}_moisture_b">loading</span>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-7">
|
|
||||||
Mode:
|
|
||||||
</div>
|
</div>
|
||||||
<select class="col-4" id="plant_${plantId}_mode">
|
<div class="row">
|
||||||
<option value="OFF">Off</option>
|
<div class="col-12">Live:</div>
|
||||||
<option value="TargetMoisture">Target</option>
|
</div>
|
||||||
<option value="TimerOnly">Timer</option>
|
<div class="row">
|
||||||
</select>
|
<div class="col-7">Sensor A:</div>
|
||||||
|
<span class="col-4" id="plant_${plantId}_moisture_a">loading</span>
|
||||||
|
<div class="col-7">Sensor B:</div>
|
||||||
|
<span class="col-4" id="plant_${plantId}_moisture_b">loading</span>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-7">
|
||||||
|
Mode:
|
||||||
|
</div>
|
||||||
|
<select class="col-4" id="plant_${plantId}_mode">
|
||||||
|
<option value="OFF">Off</option>
|
||||||
|
<option value="TargetMoisture">Target</option>
|
||||||
|
<option value="TimerOnly">Timer</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">Target Moisture:</div>
|
<div class="col-7">Target Moisture:</div>
|
||||||
<input class="col-4" id="plant_${plantId}_target_moisture" type="number" min="0" max="100" placeholder="0">
|
<input class="col-4" id="plant_${plantId}_target_moisture" type="number" min="0" max="100" placeholder="0">
|
||||||
@ -37,23 +38,24 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">Pump Cooldown (m):</div>
|
<div class="col-7">Pump Cooldown (m):</div>
|
||||||
<input class="col-4" id="plant_${plantId}_pump_cooldown_min" type="number" min="0" max="600" placeholder="30">
|
<input class="col-4" id="plant_${plantId}_pump_cooldown_min" type="number" min="0" max="600" placeholder="30">
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">"Pump Hour Start":</div>
|
<div class="col-7">"Pump Hour Start":</div>
|
||||||
<select class="col-4" id="plant_${plantId}_pump_hour_start">10</select>
|
<select class="col-4" id="plant_${plantId}_pump_hour_start">10</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">"Pump Hour End":</div>
|
<div class="col-7">"Pump Hour End":</div>
|
||||||
<select class="col-4" id="plant_${plantId}_pump_hour_end">19</select>
|
<select class="col-4" id="plant_${plantId}_pump_hour_end">19</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">Sensor B installed:</div>
|
<div class="col-7">Sensor B installed:</div>
|
||||||
<input class="col-4" id="plant_${plantId}_sensor_b" type="checkbox">
|
<input class="col-4" id="plant_${plantId}_sensor_b" type="checkbox">
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-7">Max Consecutive Pump Count:</div>
|
<div class="col-7">Max Consecutive Pump Count:</div>
|
||||||
<input class="col-4" id="plant_${plantId}_max_consecutive_pump_count" type="number" min="1", max="50", placeholder="10">
|
<input class="col-4" id="plant_${plantId}_max_consecutive_pump_count" type="number" min="1" , max="50" ,
|
||||||
</div>
|
placeholder="10">
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
@ -66,7 +66,10 @@ export class PlantView {
|
|||||||
const template = require('./plant.html') as string;
|
const template = require('./plant.html') as string;
|
||||||
const plantRaw = template.replaceAll("${plantId}", String(plantId));
|
const plantRaw = template.replaceAll("${plantId}", String(plantId));
|
||||||
this.plantDiv.innerHTML = plantRaw
|
this.plantDiv.innerHTML = plantRaw
|
||||||
this.plantDiv.classList.add("col-auto" )
|
|
||||||
|
this.plantDiv.classList.add("col-12" )
|
||||||
|
this.plantDiv.classList.add("col-sm-6" )
|
||||||
|
this.plantDiv.classList.add("col-md-auto" )
|
||||||
parent.appendChild(this.plantDiv)
|
parent.appendChild(this.plantDiv)
|
||||||
|
|
||||||
this.header = document.getElementById("plant_"+plantId+"_header")!
|
this.header = document.getElementById("plant_"+plantId+"_header")!
|
||||||
|
@ -1,27 +1,29 @@
|
|||||||
<h3>Tank:</h3>
|
<div class="row">
|
||||||
<div>
|
<div class="col-12" style="font-weight: bold; text-align: center;">Tank:</div>
|
||||||
<input type="checkbox" id="tank_sensor_enabled">
|
|
||||||
Enable Tank Sensor
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="row">
|
||||||
<input type="checkbox" id="tank_allow_pumping_if_sensor_error">
|
<input class="col-4" type="checkbox" id="tank_sensor_enabled">
|
||||||
Allow Pumping if Sensor Error
|
<div class="col-7">Enable Tank Sensor</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<input class="col-4" type="checkbox" id="tank_allow_pumping_if_sensor_error">
|
||||||
|
<div class="col-7">Ignore Sensor Error</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div class="row">
|
||||||
<input type="number" min="2" max="500000" id="tank_useable_ml">
|
<input class="col-4" type="number" min="2" max="500000" id="tank_useable_ml">
|
||||||
Tank Size mL
|
<div class="col-7">Tank Size mL</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="row">
|
||||||
<input type="number" min="1" max="500000" id="tank_warn_percent">
|
<input class="col-4" type="number" min="1" max="500000" id="tank_warn_percent">
|
||||||
Tank Warn Percent (mapped in relation to empty and full)
|
<div class="col-7">Tank Warn Percent (mapped in relation to empty and full)</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="row">
|
||||||
<input type="number" min="0" max="100" id="tank_empty_percent">
|
<input class="col-4" type="number" min="0" max="100" id="tank_empty_percent">
|
||||||
Tank Empty Percent (% max move)
|
<div class="col-7">Tank Empty Percent (% max move)</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="row">
|
||||||
<input type="number" min="0" max="100" id="tank_full_percent">
|
<input class="col-4" type="number" min="0" max="100" id="tank_full_percent">
|
||||||
Tank Full Percent (% max move)
|
<div class="col-7">Tank Full Percent (% max move)</div>
|
||||||
</div>
|
</div>
|
@ -1,8 +1,5 @@
|
|||||||
<div class="container col-sm-6 col-md-5" style="border-style: solid; border-width: 1px; padding: 8px; margin: 8px;" >
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">
|
<div class="col-12" style="text-align: center; font-weight: bold;">
|
||||||
</div>
|
|
||||||
<div class="col-4" style="text-align: center; font-weight: bold;">
|
|
||||||
Time:
|
Time:
|
||||||
</div>
|
</div>
|
||||||
<div style="display: block; right: 8px; position: absolute;">
|
<div style="display: block; right: 8px; position: absolute;">
|
||||||
@ -25,4 +22,3 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="timeview_time_upload">Store Browser time into esp and rtc</button>
|
<button id="timeview_time_upload">Store Browser time into esp and rtc</button>
|
||||||
</div>
|
|
||||||
|
@ -8,7 +8,7 @@ const isDevServer = process.env.WEBPACK_SERVE;
|
|||||||
console.log("Dev server is " + isDevServer);
|
console.log("Dev server is " + isDevServer);
|
||||||
var host;
|
var host;
|
||||||
if (isDevServer){
|
if (isDevServer){
|
||||||
host = 'http://192.168.0.103';
|
host = 'http://192.168.0.105';
|
||||||
} else {
|
} else {
|
||||||
host = '';
|
host = '';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user