updates
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
<!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="/history" class="btn">View History</a>
|
||||
<a href="/" class="btn">Dashboard</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 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>
|
||||
<script>
|
||||
// Refresh the page every 10 seconds
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
}, 20000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -54,6 +54,10 @@ tr:hover {
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="btn-container">
|
||||
<a href="/adm" class="btn">Admin</a>
|
||||
<a href="/" class="btn">Dashboard</a>
|
||||
</div>
|
||||
<h1>Database Contents</h1>
|
||||
<h2>Sensor 1</h2>
|
||||
<table border="1">
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="btn-container">
|
||||
<a href="/history" class="btn">View History</a>
|
||||
<a href="/adm" class="btn">Admin</a>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h1>Sensor Data Dashboard</h1>
|
||||
<table>
|
||||
@@ -73,10 +77,12 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<div class="btn-container">
|
||||
<a href="/history" class="btn">View History</a>
|
||||
<a href="/Admin" class="btn">Admin</a>
|
||||
</div>
|
||||
<h1>Current Weather</h1>
|
||||
{% if temperature %}
|
||||
<p>The current temperature is {{ temperature }}°C</p>
|
||||
{% else %}
|
||||
<p>Unable to fetch weather data.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<script>
|
||||
// Refresh the page every 10 seconds
|
||||
|
||||
Reference in New Issue
Block a user