142 lines
4.2 KiB
HTML
142 lines
4.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Sensor Data Dashboard</title>
|
|
<!-- <link rel="stylesheet" href="/css"> -->
|
|
<style>body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
.container {
|
|
max-width: 800px;
|
|
margin: 20px auto;
|
|
padding: 20px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 5px;
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
th, td {
|
|
padding: 8px;
|
|
text-align: left;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
tr:hover {
|
|
background-color: #f2f2f2;
|
|
}
|
|
.btn-container {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
}
|
|
.btn {
|
|
padding: 10px 20px;
|
|
font-size: 16px;
|
|
text-decoration: none;
|
|
color: #fff;
|
|
background-color: #007bff;
|
|
border: none;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
.btn:hover {
|
|
background-color: #0056b3;
|
|
}
|
|
form {
|
|
max-width: 400px;
|
|
margin: 0 auto;
|
|
background-color: #fff;
|
|
padding: 20px;
|
|
border-radius: 5px;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
select, input[type="text"], button {
|
|
width: 100%;
|
|
padding: 10px;
|
|
margin-bottom: 20px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="btn-container">
|
|
<a href="/" class="btn">Dashboard</a>
|
|
<a href="/history" class="btn">View History</a>
|
|
<a href="/adm" class="btn">Admin</a>
|
|
</div>
|
|
<div class="container">
|
|
<h1>Sensors</h1>
|
|
<table>
|
|
<tr>
|
|
<th>mac</th>
|
|
<th>Name</th>
|
|
</tr>
|
|
{% for row in data %}
|
|
<tr>
|
|
<td>{{ row[0] }}</td>
|
|
<td>{{ row[1] }}</td>
|
|
<td>{{ row[2] }}</td>
|
|
<td>{{ row[3] }}</td>
|
|
<td>{{ row[4] }}</td>
|
|
<td>{{ row[5] }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
<h1>Rename Sensor</h1>
|
|
<form action="/updateSensor" method="post">
|
|
<label for="old_name">Select sensor to rename:</label>
|
|
<select name="old_name" id="old_name">
|
|
{% for sensor in sensors %}
|
|
<option value="{{ sensor[0] }}">{{ sensor[1] }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<br><br>
|
|
<label for="new_name">Enter new name:</label>
|
|
<input type="text" name="new_name" id="new_name" required>
|
|
<br><br>
|
|
<button type="submit">Rename Sensor</button>
|
|
</form>
|
|
<h1>Alert Settings</h1>
|
|
<form method="post" action="/updateMail">
|
|
<label for="smtp_id">Sender Email:</label>
|
|
<input type="email" id="smtp_id" name="smtp_id" value="{{ email_settings[0] }}">
|
|
<br><br>
|
|
<label for="smtp_pwd">Sender Password:</label>
|
|
<input type="password" id="smtp_pwd" name="smtp_pwd" value="{{ email_settings[1] }}">
|
|
<br><br>
|
|
<label for="smtp_server">SMTP Server:</label>
|
|
<input type="text" id="smtp_server" name="smtp_server" value="{{ email_settings[2] }}">
|
|
<br><br>
|
|
<label for="smtp_port">SMTP Port:</label>
|
|
<input type="number" id="smtp_port" name="smtp_port" value="{{ email_settings[3] }}">
|
|
<br><br>
|
|
<label for="recipient_email">Recipient Email:</label>
|
|
<input type="email" id="recipient_email" name="recipient_email" value="{{ email_settings[4] }}">
|
|
<br><br>
|
|
<label for="MAX_TEMP">Temperature max threshold:</label>
|
|
<input type="number" id="MAX_TEMP" name="MAX_TEMP" value="{{ threshold_settings[1] }}">
|
|
<br><br>
|
|
<label for="MAX_HR">HR max threshold:</label>
|
|
<input type="number" id="MAX_HR" name="MAX_HR" value="{{ threshold_settings[0] }}">
|
|
<br><br>
|
|
<button type="submit">Save Settings</button>
|
|
</form>
|
|
</body>
|
|
</html>
|