webui:basic peers tab

This commit is contained in:
Martijn Voncken 2008-03-26 21:27:33 +00:00
parent b446bc0c15
commit 21efd6709d
5 changed files with 30 additions and 4 deletions

View File

@ -131,9 +131,7 @@ def reg_torrents_POST(url_name, proxy_command):
def POST(self, torrent_ids):
getattr(proxy, proxy_command)(torrent_ids)
do_redirect()
_page_class.__name__ = "TORRENTS_POST:" + proxy_command
route("/torrent/%s/(.*)" % url_name, _page_class)
reg_torrents_POST("start", "resume_torrent")

View File

@ -45,6 +45,7 @@ menu.register_detail_tab("details", _("Details"), "tab_meta")
menu.register_detail_tab("files", _("Files"), "tab_files")
menu.register_detail_tab("options", _("Options"), "tab_options")
menu.register_detail_tab("trackers", _("Trackers"), "tab_trackers")
menu.register_detail_tab("peers", _("Peers"), "tab_peers")
menu.register_toolbar_item("add", _("Add"), "list-add.png" , TB.generic, "GET","/torrent/add/", True)
menu.register_toolbar_item("delete",_("Delete"), "list-remove.png" ,TB.torrent_list, "GET","/torrent/delete/" , True)

View File

@ -0,0 +1,27 @@
$def with (torrent)
<form method="POST" action="/torrent/files/$torrent.id">
<input type="hidden" name="redir" value="$self_url()">
<table width="95%">
$altrow(True)
<tr class="tab_$altrow()">
<th>$_("Ip")</th>
<th>$_("Up Speed")</th>
<th>$_("Down Speed")</th>
<th>$_("Country")</th>
<th>$_("Client")</th>
<th>$_("progress")</th>
$for peer in torrent.peers:
<tr class="tab_$altrow()" >
<td>$peer['ip']</td>
<td>$fspeed(peer['up_speed'])</td>
<td>$fspeed(peer['down_speed'])</td>
<td>$peer['country']</td>
<td>$peer['client']</td>
<td>$peer['progress']%</td>
</tr>
</table>
</form>

View File

@ -130,4 +130,4 @@ class torrent_add:
return
def register():
component.get("PageManager").register_page("/torrent/add/(.*)",torrent_add)
component.get("PageManager").register_page("/torrent/add(.*)",torrent_add)

View File

@ -54,7 +54,7 @@ TORRENT_KEYS = ['name', 'total_size', 'num_files', 'num_pieces', 'piece_length',
'total_wanted', 'tracker', 'trackers', 'tracker_status', 'save_path',
'files', 'file_priorities', 'compact', 'max_connections',
'max_upload_slots', 'max_download_speed', 'prioritize_first_last',
'private','max_upload_speed','queue',
'private','max_upload_speed','queue','peers',
#builtin plugins:
'tracker_name' #organize-plugin
]