diff --git a/server.js b/server.js index 10f417d..7ff6fd8 100644 --- a/server.js +++ b/server.js @@ -80,7 +80,7 @@ app.get('/core/:id', function(req, res){ var d = new Date(); var coreId = req.params.id; console.log("GET /core/" + coreId + ", " + JSON.stringify(d, 4)); - db.all("SELECT coreId, published_at FROM Alerts WHERE coreId = '" + coreId + "' ORDER BY published_at DESC LIMIT 30;", function(err, rows){ + db.all("SELECT coreId, published_at, status, coreName FROM Alerts WHERE coreId = '" + coreId + "' ORDER BY published_at DESC LIMIT 30;", function(err, rows){ if(err !== null) { console.log(err); } else { diff --git a/views/core.hbs b/views/core.hbs index a0a1d1d..1c52a42 100644 --- a/views/core.hbs +++ b/views/core.hbs @@ -3,8 +3,9 @@ <h1>Alerts from a single Particle Core:</h1> <ul> {{! try to add header to list pretty core name and locale text (not sure how to pass this from node}} + {{alerts.0.coreName}} {{#each alerts}} - <li>{{this.coreId}}: {{this.published_at}}</li> + <li>{{this.published_at}}: {{this.status}}</li> {{/each}} </ul> @@ -12,6 +13,6 @@ setTimeout( function() { location.reload(); - }, 5000 + }, 10000 ); </script>