Browse Source

Create node list table

pm2
Luke Childs 8 years ago
parent
commit
96fb92dc7a
  1. 2
      viewModels/listing.js
  2. 25
      views/listing.html

2
viewModels/listing.js

@ -17,6 +17,6 @@ module.exports = (req, res) => {
return details.bridges[0];
}
});
return res.render('listing.html', { onionoo: nodes });
return res.render('listing.html', { nodes: nodes });
});
}

25
views/listing.html

@ -1,2 +1,25 @@
Hello World!
<pre>{{ onionoo }}</pre>
<table>
<thead>
<tr>
<th>Nickname</th>
<th>Bandwidth</th>
<th>Uptime</th>
<th>Country</th>
<th>Flags</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{% for node in nodes %}
<tr>
<td>{{ node.nickname }}</td>
<td>{{ node.advertised_bandwidth }}</td>
<td>{{ node.last_restarted if node.running else 'Down' }}</td>
<td>{{ node.region_name }}</td>
<td>{{ node.flags }}</td>
<td>{{ node.type }}</td>
</tr>
{% endfor %}
</tbody>
</table>

Loading…
Cancel
Save