Version 1.2
Added encrypting messages. Web interface minor redesign. Main code minor refactoring.
This commit is contained in:
@ -29,7 +29,7 @@ function loadBlock() {
|
||||
}
|
||||
document.getElementsByTagName('body')[0].innerHTML = newString;
|
||||
setFirmvareValue('version', 'firmware');
|
||||
setGpioValue('deviceSensorClassSelect', 'deviceSensorClass');
|
||||
setGpioValue('deviceClassSelect', 'deviceClass');
|
||||
handleServerResponse();
|
||||
}
|
||||
|
||||
@ -51,10 +51,9 @@ function sendRequest(submit, server) {
|
||||
}
|
||||
|
||||
function saveSetting(submit) {
|
||||
server = "/setting?deviceSensorName=" + getValue('deviceSensorName')
|
||||
+ "&deviceBatteryName=" + getValue('deviceBatteryName')
|
||||
server = "/setting?deviceName=" + getValue('deviceName')
|
||||
+ "&espnowNetName=" + getValue('espnowNetName')
|
||||
+ "&deviceSensorClass=" + getSelectValue('deviceSensorClassSelect');
|
||||
+ "&deviceClass=" + getSelectValue('deviceClassSelect');
|
||||
sendRequest(submit, server);
|
||||
alert("Please restart device for changes apply.");
|
||||
}
|
||||
|
@ -5,12 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script type="text/javascript" src="function.js"></script>
|
||||
<title>ESP-NOW Window/Door Sensor</title>
|
||||
<title>ESP-NOW Window Sensor</title>
|
||||
</head>
|
||||
|
||||
<body onload="load();">
|
||||
<form class="box">
|
||||
<h1>ESP-NOW Window/Door Sensor </h1>
|
||||
<h1>ESP-NOW Window Sensor </h1>
|
||||
<div class="wrapper">
|
||||
<p class="text">Firmware:</p>
|
||||
<p class="text" id="version"></p>
|
||||
@ -18,14 +18,8 @@
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<p class="text">Sensor name:</p>
|
||||
<input id="deviceSensorName" value="{{deviceSensorName}}" placeholder="Name" autocomplete="off" label
|
||||
title="ESP-NOW device name (up to 150 characters)" />
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<p class="text">Battery name:</p>
|
||||
<input id="deviceBatteryName" value="{{deviceBatteryName}}" placeholder="Name" autocomplete="off" label
|
||||
<p class="text">Device name:</p>
|
||||
<input id="deviceName" value="{{deviceName}}" placeholder="Name" autocomplete="off" label
|
||||
title="ESP-NOW device name (up to 150 characters)" />
|
||||
</div>
|
||||
|
||||
@ -37,8 +31,8 @@
|
||||
|
||||
<div class="wrapper">
|
||||
<p class="text-select">Sensor type:</p>
|
||||
<input id="deviceSensorClass" value="{{deviceSensorClass}}" hidden />
|
||||
<p><select id="deviceSensorClassSelect">
|
||||
<input id="deviceClass" value="{{deviceClass}}" hidden />
|
||||
<p><select id="deviceClassSelect">
|
||||
<option value="28">WINDOW</option>
|
||||
<option value="6">DOOR</option>
|
||||
</select></p>
|
||||
|
@ -1,3 +1,7 @@
|
||||
p{
|
||||
margin: 0 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Gill Sans", sans-serif;
|
||||
background: rgb(255, 255, 255);
|
||||
@ -21,13 +25,15 @@ h1 {
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.text-select {
|
||||
width: 35%;
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
margin-right: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
@ -42,6 +48,7 @@ input {
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 10px;
|
||||
padding: 0 10px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: #a3e0f1;
|
||||
@ -76,6 +83,8 @@ select:hover {
|
||||
background: rgb(65, 125, 238);
|
||||
color: white;
|
||||
transition: .5s;
|
||||
margin-left: 0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
@ -84,10 +93,13 @@ select:hover {
|
||||
transform: translatey(-3px);
|
||||
}
|
||||
|
||||
#deviceSensorName,
|
||||
#deviceBatteryName,
|
||||
#deviceName,
|
||||
#espnowNetName {
|
||||
width: 73%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#espnowNetName {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.wrapper.wrapper--end {
|
||||
|
Reference in New Issue
Block a user