Skip to content

Commit

Permalink
fixed front end and misc stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrogen18 committed Nov 2, 2013
1 parent ccb0409 commit c81293e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 8 additions & 7 deletions html/js/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Fairywren.swarm = function()
{
var div = $("<div />");

var a = $("<a />");
var a = $("<span />");
a.text(username);
var user = Fairywren.swarm.data[username]
a.attr('href' ,'user.html#' + user.href );
//a.attr('href' ,'user.html#' + user.href );

div.append($("<h4 />").append(a));

Expand All @@ -37,22 +37,23 @@ Fairywren.swarm = function()
var tr = $("<tr />");
tr.append($("<th />").text('IP'));
tr.append($("<th />").text('Port'));
tr.append($("<th />").text('# Torrents'));
tr.append($("<th />").text('Last Seen'));
tr.append($("<th />").text('First Seen'));

thead.append(tr);
table.append(thead);

var tbody = $("<tbody />");

for(var i = 0; i != user.peers.length; ++i)
for(var i = 0; i != user.length; ++i)
{
var tr = $("<tr />");

var peer = user.peers[i];
var peer = user[i];
tr.append($("<td />").text(peer.ip));
tr.append($("<td />").text(peer.port));
tr.append($("<td />").text(peer.quantity));

tr.append($("<td />").text(Fairywren.trimIsoFormatDate(peer.lastSeen)));
tr.append($("<td />").text(Fairywren.trimIsoFormatDate(peer.firstSeen)));

tbody.append(tr);
}
Expand Down
8 changes: 8 additions & 0 deletions standalone_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from auth import *
from peers import *

import swarm
import vanilla
import psycopg2
import sys
Expand Down Expand Up @@ -35,5 +36,12 @@
peerList = Peers(redisConnPool,60*60*6)
tracker = Tracker(authmgr,peerList,httpPathDepth)

swarmConnPool = vanilla.buildConnectionPool(psycopg2,**conf['tracker']['postgresql'])
swarm = swarm.Swarm()
swarm.setConnectionPool(swarmConnPool)
eventlet.spawn_n(swarm)

tracker.addAfterAnnounce(swarm.pushPeer)

eventlet.spawn_n(peerList)
wsgi.server(eventlet.listen((httpListenIp, httpListenPort)), tracker)
2 changes: 1 addition & 1 deletion standalone_webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#process.
peerList = peers.Peers(redisConnPool,0)

swarmConnPool = vanilla.buildSwarmConnectionPool(**conf['webapi']['postgresql'])
swarmConnPool = vanilla.buildConnectionPool(psycopg2,**conf['webapi']['postgresql'])
swarm = swarm.Swarm()
swarm.setConnectionPool(swarmConnPool)

Expand Down

0 comments on commit c81293e

Please sign in to comment.