-
Notifications
You must be signed in to change notification settings - Fork 0
/
databme680.html
202 lines (178 loc) · 9 KB
/
databme680.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!doctype html>
<html lang="en">
<head>
<!-- AWS SDK for JS CDN -->
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.16.min.js"></script>
<!-- ChartJS 2.8 CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<!-- JQuery 1.11 CDN -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>-->
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>-->
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- GoogleFonts -->
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
<!-- Fontawesome personal kit code -->
<script src="https://kit.fontawesome.com/924e924aa8.js" crossorigin="anonymous"></script>
<!-- CSS Link-->
<link rel="stylesheet" href="./css/style.css">
<title>IoT Dashboard</title>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-light">
<button class="navbar-toggler ml-auto mb-2 bg-light" type="button" data-toggle="collapse" data-target="#myNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="myNavbar">
<div class="container-fluid">
<div class="row">
<!-- sidebar -->
<div class="col-xl-2 col-lg-3 col-md-4 sidebar fixed-top">
<a href="#" class="navbar-brand text-white d-block mx-auto text-center py-3 mb-4 bottom-border">IoT Dashboard</a>
<div class="bottom-border pb-3">
<img src="imgs/photo-1548009813-c6442fa355dc.jpg" width="50" class="rounded-circle mr-3">
<a href="#" class="text-white">María Rueda</a>
</div>
<ul class="navbar-nav flex-column mt-4">
<li class="nav-item">
<a href="index.html" class="nav-link text-white p-3 mb-2 sidebar-link">
<i class="fas fa-home text-light fa-lg mr-3"></i>
Home
</a>
</li>
<li class="nav-item">
<a href="Charts2.html" class="nav-link text-white p-3 mb-2 sidebar-link">
<i class="fas fa-chart-bar text-light fa-lg mr-3"></i>
Charts
</a>
</li>
<li class="nav-item">
<a href="datadht22.html" class="nav-link text-white p-3 mb-2 sidebar-link">
<i class="fas fa-temperature-low text-light fa-lg mr-3"></i>
DHT22
</a>
</li>
<li class="nav-item">
<a href="databme680.html" class="nav-link text-white p-3 mb-2 sidebar-link current">
<i class="fas fa-cloud-sun-rain text-light fa-lg mr-3"></i>
BME680
</a>
</li>
</ul>
</div>
<!-- End sidebar -->
<!-- top-nav -->
<div class="col-xl-10 col-lg-9 col-md-8 ml-auto bg-dark fixed-top py-2 top-navbar">
<div class="row align-items-center">
<div class="col-md-4">
<h4 class="text-light text-uppercase mb-0">Dashboard</h4>
</div>
<div class="col-md-5">
<form>
<div class="input-group">
<input type="text" class="form-control search-input" placeholder="Search...">
<button type="button" class="btn btn-white search-button">
<i class="fas fa-search text-danger"></i>
</button>
</div>
</form>
</div>
<div class="col-md-3">
<ul class="navbar-nav">
<li class="nav-item icon-parent">
<a href="#" class="nav-link icon-bullet"><i class="fas fa-comments text-muted fa-lg"></i></a>
</li>
<li class="nav-item icon-parent">
<a href="#" class="nav-link icon-bullet"><i class="fas fa-bell text-muted fa-lg"></i></a>
</li>
<li class="nav-item ml-md-auto">
<a href="#" class="nav-link" data-toggle="modal" data-target="#sign-out"><i class="fas fa-sign-out-alt text-danger fa-lg"></i></a>
</li>
</ul>
</div>
</div>
</div>
<!-- End sidebar -->
</div>
</div>
</div>
</nav>
<!-- End of Navbar -->
<!-- Buttons and Text area -->
<section>
<div class="container-fluid text-center">
<div class="row">
<div class="col-xl-10 col-lg-9 col-md-8 ml-auto">
<div class="row pt-md-5 mt-3 mb-1 d-flex justify-content-center">
<button class="btn btn-info mx-0 mx-sm-2" id="scanTime24hb" type="button" value="Scan" onclick="scanTime24hb();">Last 24h</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTime3ldb" type="button" value="Scan" onclick="scanTime3ldb();">Last 3 days</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTime7ldb" type="button" value="Scan" onclick="scanTime7ldb();">Last 7 days</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTime2wb" type="button" value="Scan" onclick="scanTime2wb();">Last 2 weeks</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTime3wb" type="button" value="Scan" onclick="scanTime3wb();">Last 3 weeks</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTimelmb" type="button" value="Scan" onclick="scanTimelmb();">Last Month</button>
<button class="btn btn-info mx-0 mx-sm-2" id="scanTimelrb" type="button" value="Scan" onclick="scanTimelrb();">All records</button>
<textarea class="mx-0 mx-sm-2 mt-3 mb-1" readonly id= "textareabme" style="width:1300px; height:400px"></textarea>
</div>
<div class="d-flex justify-content-end">
<form action="/action_page.php">
Give a name the CSV archive:
<input type="text" name="" value="filename.csv" id="filename">
<button class="btn btn-success mx-0 mx-sm-2" id="download.btn" type="button">Download Data</button>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- End of Buttons and text area -->
<!-- Modal -->
<div class="modal fade text-center" id="sign-out">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Are you sure, you want to live?</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
Press logout to leave
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Stay Here</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Logout</button>
</div>
</div>
</div>
</div>
<!-- End of Modal -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- My Own JS Script -->
<script src="./js/script.js"></script>
<!-- My Own Charts -->
<script src="./js/chartTwo.js"></script>
<script src="./js/Pruebas.js"></script>
<script>
function downloadBME680(filename, text) {
var element = document.createElement('a');
element.style.display = 'none';
element.setAttribute('href', 'data:text/plain;charset=utf-8, ' + encodeURIComponent(text));
element.setAttribute('download', filename);
document.body.appendChild(element);
element.click();
document.body.removeChild(Element);
}
document.getElementById("download.btn").addEventListener("click", function(){
var text = document.getElementById("textareabme").value;
var filename = document.getElementById("filename").value;
downloadBME680(filename, text);
}, false);
</script>
</body>
</html>