CanGrow/playground/html/root/index.html

146 lines
4.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>CanGrow - CanGrow v0.2-dev</title>
<link rel='stylesheet' href='cangrow.css'>
<style>
.outputSel {
display: none;
}
</style>
<script>
function toggleDisplay(id) {
let el = document.getElementById(id);
let el_cs = getComputedStyle(el);
if (el_cs.getPropertyValue('display') === 'none') {
el.style.display = 'inline';
} else {
el.style.display = 'none';
}
}
function hideAllClass(classname) {
const el = document.getElementsByClassName(classname);
for(let i = 0; i < el.length ; i++) {
el[i].style.display = '';
}
}
function showSelect(selectId, prefix, hideClass = '') {
if(hideClass != '') {
hideAllClass(hideClass);
}
let selVal = document.getElementById(selectId).value;
toggleDisplay(prefix + selVal);
}
</script>
</head>
<body>
<ul class='nav'><li><a href='/'>&#x1F331; CanGrow</a></li>
<li><a class='' href='/grow/' >&#128262; Grow settings</a></li>
<li><a class='activeNav' href='/system/' >&#9881; System settings</a></li>
<li><a class='' href='/wifi/' >&#128225; WiFi settings</a></li>
<li><a class='' href='/help' >&#x2753; Help</a></li>
<li><span class='navTime'>04:20:23</span></li>
<li><a href='https://git.la10cy.net/DeltaLima/CanGrow' target='_blank'>CanGrow v0.2-dev</a></li>
</ul>
<div class='center'>
<ul class='subnav'>
<li><a class='activeNav' href='/system/output/'>&#9889; Output configuration</a></li>
<li><a class='' href='/system/update'>&#x1F504; Firmware update</a></li>
<li><a class='' href='/system/restart' >&#x1F501; CanGrow restart</a></li>
<li><a class='' href='/system/wipe' >&#x1F4A3; Factory reset</a></li>
</ul>
<h3>&#10133; Add output</h3>
<p>Add a new output to CanGrow.</p>
<form method='post' action='/system/output/add'>
<u>Type</u>:<br>
<select id='type_sel' name='config.system.httpLogSerial' onchange="showSelect('type_sel', 'type_', 'outputSel');" required>
<option disabled value='' selected hidden>---</option>
<option value='1'>GPIO</option>
<option value='2'>I2C</option>
<option value='3'>URL</option>
</select><br>
<u>Device</u>:<br>
<select name='config.system.httpLogSerial' required>
<option disabled value='' selected hidden>---</option>
<option value='1'>Light</option>
<option value='2'>Fan</option>
<option value='3'>Pump</option>
<option value='3'>Humidifier</option>
<option value='3'>Dehumidifier</option>
<option value='3'>Heating</option>
</select><br>
<u>Name</u>:<br>
<input type='text' name='esp32camIp' maxlength='16' value='' ><br>
<u>Enable</u>:<br>
<select name='config.system.httpLogSerial' required>
<option disabled value='' selected hidden>---</option>
<option value='1'>Yes</option>
<option value='0'>No</option>
</select><br>
<div class='outputSel' id='type_1'>
<u>GPIO</u>:<br>
<select name='config.system.httpLogSerial' required>
<option disabled value='' selected hidden>---</option>
<option value='0'>GPIO 0 !BFL!</option>
<option value='1'>GPIO 12</option>
<option value='2'>GPIO 13</option>
<option value='2'>GPIO 14</option>
<option value='2'>GPIO 15 !BFH!</option>
<option value='2'>GPIO 16 !NOPWM!</option>
</select><br>
<u>GPIO PWM</u>:<br>
<select name='config.system.httpLogSerial' required>
<option disabled value='' selected hidden>---</option>
<option value='1'>Enable</option>
<option value='2'>Disable</option>
</select><br>
</div>
<div class='outputSel' id='type_2'>
<u>I2C</u>:<br>
<input type='text' name='esp32camIp' maxlength='16' value='' ><br>
</div>
<div class='outputSel' id='type_3'>
<u>Host</u>:<br>
<input type='text' name='esp32camIp' maxlength='16' value='' ><br>
<u>URI on</u>:<br>
<input type='text' name='esp32camIp' maxlength='16' value='' ><br>
<u>URI off</u>:<br>
<input type='text' name='esp32camIp' maxlength='16' value='' ><br>
</div>
<br>
<input type='submit' value='&#x1F4BE; Save settings'>
</form>
<script>
</script>
<div class='footer'><span>Build: d679d89-esp8266-20241024231631</span></div>
</div></body></html>