Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #98

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
<label class="col-md-4 control-label" for="newFingerprintName">Name</label>
<div class="col-md-4">
<input id="newFingerprintName" name="newFingerprintName" type="text" placeholder="(optional)" class="form-control input-md">
<small class="text-muted">Just for human readability you can additionally assign an name to your slot number. The name will also been published by MQTT.</small>
<small class="text-muted">Just for human readability you can additionally assign an name to your slot number. The name will also been published by MQTT.<br>
If the name ends with a '#' the door opener output pin is activated, too.</small>
</div>
</div>

Expand All @@ -142,7 +143,8 @@
<p></p>
<nav class="navbar navbar-default ">
<div class="container-fluid">
<p class="navbar-text">FingerprintDoorbell, Version %VERSIONINFO%</p>
<p class="navbar-text">FingerprintDoorbell, Version %VERSIONINFO%</p>
<p class="navbar-text">%UPTIME%</p>
</div>
</nav>

Expand Down
318 changes: 211 additions & 107 deletions data/settings.html
Original file line number Diff line number Diff line change
@@ -1,151 +1,255 @@
<!DOCTYPE html>
<html>

<head>
<!-- created with https://bootstrapformbuilder.com/ -->
<title>FingerprintDoorbell</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
.alert-custom{
background-color:#cecece;
color:rgb(0, 0, 0);
}
.form-horizontal{
margin-left: 15px;
margin-right: 15px;
}
</style>
<!-- created with https://bootstrapformbuilder.com/ -->
<title>FingerprintDoorbell</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
.alert-custom {
background-color: #cecece;
color: rgb(0, 0, 0);
}

.form-horizontal {
margin-left: 15px;
margin-right: 15px;
}
</style>
</head>

<body>
<script>
if (!!window.EventSource) {
var source = new EventSource('/events');

source.addEventListener('open', function(e) {
source.addEventListener('open', function (e) {
console.log("Events Connected");
}, false);

source.addEventListener('error', function(e) {
source.addEventListener('error', function (e) {
if (e.target.readyState != EventSource.OPEN) {
console.log("Events Disconnected");
console.log("Events Disconnected");
}
}, false);

// event is fired when a new message from server was received
source.addEventListener('message', function(e) {
source.addEventListener('message', function (e) {
console.log("message", e.data);
document.getElementById('logMessages').innerHTML = event.data;
}, false);

}
</script>
</script>

<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/">%HOSTNAME%</a>
</div>
<ul class="nav navbar-nav">
<li><a href="/">Fingerprints</a></li>
<li class="active"><a href="#">Settings</a></li>
</ul>
<div class="navbar-header">
<a class="navbar-brand" href="/">%HOSTNAME%</a>
</div>
<ul class="nav navbar-nav">
<li><a href="/">Fingerprints</a></li>
<li class="active"><a href="#">Settings</a></li>
</ul>
</div>
</nav>

<div class="alert alert-custom" id="logMessages" role="alert">%LOGMESSAGES%</div>

<form class="form-horizontal" action="/settings">
<fieldset>

<!-- Form Name -->
<legend>Settings</legend>

<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_server">MQTT Server (Broker)</label>
<div class="col-md-4">
<input id="mqtt_server" name="mqtt_server" type="text" placeholder="Address of your MQTT Broker" class="form-control input-md" value="%MQTT_SERVER%" required>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_username">MQTT Username</label>
<div class="col-md-4">
<input id="mqtt_username" name="mqtt_username" type="text" placeholder="Username for connecting to your MQTT Broker" class="form-control input-md" value="%MQTT_USERNAME%">
<small class="text-muted">Leave empty if your broker is not requiring authentication.</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_password">MQTT Password</label>
<div class="col-md-4">
<input id="mqtt_password" name="mqtt_password" type="text" placeholder="Password for connecting to your MQTT Broker" class="form-control input-md" value="%MQTT_PASSWORD%">
<small class="text-muted">Leave empty if your broker is not requiring authentication.</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_rootTopic">MQTT Root Topic</label>
<div class="col-md-4">
<input id="mqtt_rootTopic" name="mqtt_rootTopic" type="text" placeholder="Root topic where FingerprintDoorbell publishes its messages" class="form-control input-md" value="%MQTT_ROOTTOPIC%" required>
<small class="text-muted">Published Topics (=write)<br>
- "%MQTT_ROOTTOPIC%/ring"<br>
- "%MQTT_ROOTTOPIC%/matchId"<br>
- "%MQTT_ROOTTOPIC%/matchName"<br>
- "%MQTT_ROOTTOPIC%/matchConfidence"<br>
- "%MQTT_ROOTTOPIC%/lastLogMessage"<br>
Subscribed Topics (=read)<br>
- "%MQTT_ROOTTOPIC%/ignoreTouchRing"
</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="ntpServer">NTP Server</label>
<div class="col-md-4">
<input id="ntpServer" name="ntpServer" type="text" placeholder="URL to NTP server" class="form-control input-md" value="%NTP_SERVER%">
<small class="text-muted">Used for timestamps in log panel. If you don't specify any, time will be always null.</small>
</div>
</div>

<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="btnSaveSettings"></label>
<div class="col-md-4">
<button id="btnSaveSettings" name="btnSaveSettings" class="btn btn-success">Save and Restart</button>
</div>
</div>

</fieldset>
<fieldset>

<!-- Form Name -->
<legend>Settings</legend>

<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="web_password">Web Password</label>
<div class="col-md-4">
<input id="web_password" name="web_password" type="text"
placeholder="Password for website" class="form-control input-md" value="%WEB_PASSWORD%">
<small class="text-muted">User name is "admin", leave empty if no authentication required</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_server">MQTT Server [:port]</label>
<div class="col-md-4">
<input id="mqtt_server" name="mqtt_server" type="text" placeholder="Address of your MQTT Broker"
class="form-control input-md" value="%MQTT_SERVER%" required>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_username">MQTT Username</label>
<div class="col-md-4">
<input id="mqtt_username" name="mqtt_username" type="text"
placeholder="Username for connecting to your MQTT Broker" class="form-control input-md"
value="%MQTT_USERNAME%">
<small class="text-muted">Leave empty if your broker is not requiring authentication.</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_password">MQTT Password</label>
<div class="col-md-4">
<input id="mqtt_password" name="mqtt_password" type="text"
placeholder="Password for connecting to your MQTT Broker" class="form-control input-md"
value="%MQTT_PASSWORD%">
<small class="text-muted">Leave empty if your broker is not requiring authentication.</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="mqtt_rootTopic">MQTT Root Topic</label>
<div class="col-md-4">
<input id="mqtt_rootTopic" name="mqtt_rootTopic" type="text"
placeholder="Root topic where FingerprintDoorbell publishes its messages"
class="form-control input-md" value="%MQTT_ROOTTOPIC%" required>
<small class="text-muted"><u>Published Topics (=write)</u><br>
- "%MQTT_ROOTTOPIC%/ring"<br>
- "%MQTT_ROOTTOPIC%/matchId"<br>
- "%MQTT_ROOTTOPIC%/matchName"<br>
- "%MQTT_ROOTTOPIC%/matchConfidence"<br>
- "%MQTT_ROOTTOPIC%/lastLogMessage"<br>
<u>Subscribed Topics (=read)</u><br>
- "%MQTT_ROOTTOPIC%/ignoreTouchRing: on/off"<br>
- "%MQTT_ROOTTOPIC%/openDoor: true"
</small>
</div>
</div>

<div class="form-group">
<label class="col-md-4 control-label" for="ntpServer">NTP Server</label>
<div class="col-md-4">
<input id="ntpServer" name="ntpServer" type="text" placeholder="URL to NTP server"
class="form-control input-md" value="%NTP_SERVER%">
<small class="text-muted">Used for timestamps in log panel. If you don't specify any, time will be
always null.</small>
</div>
</div>

<div class="form-group">
<label for="touchRingActiveColor" class="col-md-4 control-label">Touch Ring Active: LED Color</label>
<div class="col-md-4">
<select id="touchRingActiveColor" name="touchRingActiveColor" class="select form-control">
<option value="1" %TOUCH_RING_ACTIVE_COLOR_1%>Red</option>
<option value="2" %TOUCH_RING_ACTIVE_COLOR_2%>Blue</option>
<option value="3" %TOUCH_RING_ACTIVE_COLOR_3%>Purple</option>
<option value="4" %TOUCH_RING_ACTIVE_COLOR_4%>Green</option>
<option value="5" %TOUCH_RING_ACTIVE_COLOR_5%>Yellow</option>
<option value="6" %TOUCH_RING_ACTIVE_COLOR_6%>Cyan</option>
<option value="7" %TOUCH_RING_ACTIVE_COLOR_7%>White</option>
</select>
<small class="text-muted">Not all versions of the R503 sensor supports all colors. Older ones only
red, blue and purple!</small>
</div>
</div>
<div class="form-group">
<label for="touchRingActiveSequence" class="col-md-4 control-label">Touch Ring Active: LED
Sequence</label>
<div class="col-md-4">
<label class="radio-inline">
<input type="radio" name="touchRingActiveSequence" value="4" %TOUCH_RING_ACTIVE_SEQUENCE_4%>
Off
</label>
<label class="radio-inline">
<input type="radio" name="touchRingActiveSequence" value="3" %TOUCH_RING_ACTIVE_SEQUENCE_3%>
On
</label>
<label class="radio-inline">
<input type="radio" name="touchRingActiveSequence" value="1" %TOUCH_RING_ACTIVE_SEQUENCE_1%>
Breath
</label>
<label class="radio-inline">
<input type="radio" name="touchRingActiveSequence" value="2" %TOUCH_RING_ACTIVE_SEQUENCE_2%>
Blink
</label>
</div>
</div>
<div class="form-group">
<label for="scanColor" class="col-md-4 control-label">Scan fingerprint: LED Color</label>
<div class="col-md-4">
<select id="scanColor" name="scanColor" class="select form-control">
<option value="1" %SCAN_COLOR_1%>Red</option>
<option value="2" %SCAN_COLOR_2%>Blue</option>
<option value="3" %SCAN_COLOR_3%>Purple</option>
<option value="4" %SCAN_COLOR_4%>Green</option>
<option value="5" %SCAN_COLOR_5%>Yellow</option>
<option value="6" %SCAN_COLOR_6%>Cyan</option>
<option value="7" %SCAN_COLOR_7%>White</option>
</select>
<small class="text-muted">Not all versions of the R503 sensor supports all colors. Older ones only
red, blue and purple!</small>
</div>
</div>
<div class="form-group">
<label for="matchColor" class="col-md-4 control-label">Matching fingerprint: LED Color</label>
<div class="col-md-4">
<select id="matchColor" name="matchColor" class="select form-control">
<option value="1" %MATCH_COLOR_1%>Red</option>
<option value="2" %MATCH_COLOR_2%>Blue</option>
<option value="3" %MATCH_COLOR_3%>Purple</option>
<option value="4" %MATCH_COLOR_4%>Green</option>
<option value="5" %MATCH_COLOR_5%>Yellow</option>
<option value="6" %MATCH_COLOR_6%>Cyan</option>
<option value="7" %MATCH_COLOR_7%>White</option>
</select>
<small class="text-muted">Not all versions of the R503 sensor supports all colors. Older ones only
red, blue and purple!</small>
</div>
</div>

<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="btnSaveSettings"></label>
<div class="col-md-4">
<button id="btnSaveSettings" name="btnSaveSettings" class="btn btn-success">Save and
Restart</button>
</div>
</div>

</fieldset>
</form>

<form class="form-horizontal">
<fieldset>

<!-- Form Name -->
<legend>Advanced Actions</legend>

<div class="form-group">
<label class="col-md-4 control-label" for="btnFirmwareUpdate"></label>
<div class="col-md-4">
<button id="btnFirmwareUpdate" name="btnFirmwareUpdate" class="btn btn-info" type="submit" formaction="update">Firmware-Update </button>
<button id="btnDoPairing" name="btnDoPairing" class="btn btn-warning" type="submit" formaction="pairing">Pairing a new sensor </button>
<button id="btnDeleteAllFingerprints" name="btnDeleteAllFingerprints" class="btn btn-danger" type="submit" formaction="deleteAllFingerprints" onclick="return confirm('This will delete all fingerprints. Are you sure you wanna do that?')">Delete all Fingerprints</button>
<button id="btnFactoryReset" name="btnFactoryReset" class="btn btn-danger" type="submit" formaction="factoryReset" onclick="return confirm('This will delete all fingerprints, your settings and your WiFi configuration. Are you sure you wanna do that?')">Factory-Reset</button>
</div>
</div>

</fieldset>
<fieldset>

<!-- Form Name -->
<legend>Advanced Actions</legend>

<div class="form-group">
<label class="col-md-4 control-label" for="btnFirmwareUpdate"></label>
<div class="col-md-4">
<button id="btnFirmwareUpdate" name="btnFirmwareUpdate" class="btn btn-info" type="submit"
formaction="update">Firmware-Update </button>
<button id="btnDoPairing" name="btnDoPairing" class="btn btn-warning" type="submit"
formaction="pairing">Pairing a new sensor </button>
<button id="btnDeleteAllFingerprints" name="btnDeleteAllFingerprints" class="btn btn-danger"
type="submit" formaction="deleteAllFingerprints"
onclick="return confirm('This will delete all fingerprints. Are you sure you wanna do that?')">Delete
all Fingerprints</button>
<button id="btnFactoryReset" name="btnFactoryReset" class="btn btn-danger" type="submit"
formaction="factoryReset"
onclick="return confirm('This will delete all fingerprints, your settings and your WiFi configuration. Are you sure you wanna do that?')">Factory-Reset</button>
</div>
</div>

</fieldset>
</form>


<p></p>
<nav class="navbar navbar-default ">
<div class="container-fluid">
<p class="navbar-text">FingerprintDoorbell, Version %VERSIONINFO%</p>
<p class="navbar-text">FingerprintDoorbell, Version %VERSIONINFO%</p>
<p class="navbar-text">%UPTIME%</p>
</div>
</nav>

</body>
</html>

</html>
Loading