temp monitor interface

pull/2422/head
dapgo 2022-12-23 16:17:03 +01:00
parent c9a7291fcb
commit 5efa613c87
4 changed files with 10 additions and 4 deletions

View File

@ -26,15 +26,20 @@ function getData() {
return;
}
// Otherwise parse the data and output it as a table
//<td>${(new Date(l[0]*1000)).toLocaleString()}</td>
dataElement.innerHTML = `<table>
<tr>
<th>Month</th>
<th>Day</th>
<th>Time</th>
<th>temperature</th>
</tr>`+data.trim().split("\n").map(l=>{
l = l.split(";");
return `<tr>
<td>${(new Date(l[0]*1000)).toLocaleString()}</td>
<td>${l[0]}</td>
<td>${l[1]}</td>
<td>${l[2]}</td>
<td>${l[3]}</td>
</tr>`
}).join("\n")+"</table>";
});

View File

@ -8,7 +8,7 @@
"interface": "interface.html",
"supports": ["BANGLEJS", "BANGLEJS2"],
"readme": "README.md",
"screenshots": [{"url":"photo_banglejs1.jpg"}],
"screenshots": [{"url":"ss_emul_bjs2.png"}],
"allow_emulator": true,
"storage": [
{"name":"tempmonitor.app.js","url":"tempmonitor.app.js"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -71,7 +71,8 @@ function saveToFile() {
if (v_mode_debug==1) console.log("saving="+strlastSaveTime+";"+lastMeasure);
if (v_saveToFile=='Y'){
require("Storage").open(filename,"a").write(strlastSaveTime+";"+lastMeasure+"\n");
//write(strlastSaveTime+";"+
require("Storage").open(filename,"a").write(a.getMonth()+";"+a.getDate()+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure+"\n");
//(getTime()+",");
v_saved_entries=v_saved_entries+1;
}