mirror of https://github.com/espruino/BangleApps
temp monitor interface
parent
c9a7291fcb
commit
5efa613c87
|
@ -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>";
|
||||
});
|
||||
|
|
|
@ -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 |
|
@ -69,9 +69,10 @@ function saveToFile() {
|
|||
strlastSaveTime=a.toISOString();
|
||||
//strlastSaveTime=strlastSaveTime.concat(a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes());;
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue