1
0
mirror of https://github.com/Adam-Ant/MQTT-nRF24-Bridge synced 2025-06-29 11:50:57 +00:00

Add spiffs web data, and start of input processing

This commit is contained in:
Adam Dodman
2018-01-27 17:23:12 +00:00
parent 031833ca9f
commit 1a1001bca3
4 changed files with 58 additions and 31 deletions

40
data/index.html Normal file
View File

@ -0,0 +1,40 @@
<html>
<head>
<title>ESP8266 Input Example</title>
<style>
body {
background-color: #E6E6FA;
font-family: Arial, Helvetica, Sans-Serif;
Color: blue;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
var counter = 1;
function addInput(tableName){
var newrow = document.createElement('tr');
newrow.innerHTML = "<td><input type='text' name='mqtt" + counter + "'></td><td><input type='text' name='node" + counter + "'></td>"
document.getElementById(tableName).appendChild(newrow);
counter++;
}
</script>
</head>
<body>
<h1><br>ESP8266 Server - Getting input from a client</h1>
<form action='/submit' method='POST'>
<table id='dynamicInput'>
<tr>
<th>MQTT Address</th>
<th>Node ID</th>
</tr>
<tr><td><input type='text' name='mqtt0'></td><td><input type='text' name='node0'></td></tr>
</table>
<input type='submit' value='Enter'> <input type="button" value="Add another text input" onClick="addInput('dynamicInput');">
</form>
</body>
</html>