map.js 625 B

12345678910111213141516171819202122232425
  1. (function (window, $) {
  2. App.prototype.init = function () {
  3. var map = $('#map'),
  4. nodesTmpl = this.render([
  5. '<tr>',
  6. '<td>%ip%</td>',
  7. '<td>%link%</td>',
  8. '<td>%path%</td>',
  9. '<td>%version%</td>',
  10. '</tr>'
  11. ].join(''));
  12. this.send('/map', function (resp) {
  13. var nodes = resp.nodes;
  14. if (nodes) {
  15. nodes = nodes.map(nodesTmpl);
  16. map.html(nodes.join(''));
  17. }
  18. });
  19. };
  20. new App();
  21. } (window, jQuery));