add status text; add device name header; closes issue #6
This commit is contained in:
		
							parent
							
								
									f31b4e1460
								
							
						
					
					
						commit
						7658ca5e42
					
				@ -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 {
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user