2024-04-06 02:57:04 +00:00
|
|
|
<html>
|
2024-04-06 03:24:47 +00:00
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="../../css/spectre.min.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
2024-04-16 19:18:19 +00:00
|
|
|
<div id="data"></div>
|
2024-04-06 02:57:04 +00:00
|
|
|
|
2024-04-06 03:24:47 +00:00
|
|
|
<script src="../../core/lib/interface.js"></script>
|
|
|
|
<script>
|
2024-04-16 19:18:19 +00:00
|
|
|
var dataElement = document.getElementById("data");
|
2024-04-06 02:57:04 +00:00
|
|
|
|
2024-04-16 19:18:19 +00:00
|
|
|
function getHeartRateData() {
|
|
|
|
Util.showModal("Loading...");
|
|
|
|
dataElement.innerHTML = "";
|
|
|
|
Puck.eval('require("Storage").list(/heart_rate_data\\.csv\\x01/)', files => {
|
|
|
|
if (files.length == 0) {
|
|
|
|
dataElement.innerHTML = "<p>No heart rate data found</p>";
|
2024-04-06 03:24:47 +00:00
|
|
|
} else {
|
2024-04-16 19:18:19 +00:00
|
|
|
files.forEach(fn => {
|
|
|
|
fn = fn.slice(0, -1);
|
|
|
|
var link = document.createElement("a");
|
|
|
|
link.setAttribute("href", "#");
|
|
|
|
link.textContent = fn;
|
|
|
|
link.addEventListener("click", function() {
|
|
|
|
Util.showModal("Downloading...");
|
|
|
|
Util.readStorageFile(fn, function(data) {
|
|
|
|
Util.saveCSV(fn.slice(0, -4), data);
|
|
|
|
Util.hideModal();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
dataElement.appendChild(link);
|
|
|
|
dataElement.appendChild(document.createElement("br"));
|
|
|
|
});
|
2024-04-06 03:24:47 +00:00
|
|
|
}
|
2024-04-10 19:36:33 +00:00
|
|
|
Util.hideModal();
|
2024-04-06 03:24:47 +00:00
|
|
|
});
|
|
|
|
}
|
2024-04-06 02:57:04 +00:00
|
|
|
|
2024-04-16 19:18:19 +00:00
|
|
|
// Called when app starts
|
2024-04-06 03:24:47 +00:00
|
|
|
function onInit() {
|
2024-04-16 19:18:19 +00:00
|
|
|
getHeartRateData();
|
2024-04-06 03:24:47 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
2024-04-06 02:57:04 +00:00
|
|
|
</html>
|