webui:fix TORRENT_STATE
This commit is contained in:
parent
0e31d4243c
commit
985ccb3187
|
@ -396,9 +396,11 @@ class daemon_control:
|
|||
proxy.shutdown()
|
||||
elif command == 'start':
|
||||
self.start()
|
||||
return do_redirect()
|
||||
elif command == 'restart':
|
||||
proxy.shutdown()
|
||||
self.start()
|
||||
return do_redirect()
|
||||
else:
|
||||
raise Exception('Unknown command:"%s"' % command)
|
||||
|
||||
|
|
|
@ -222,8 +222,9 @@ body.inner {
|
|||
height:20px;
|
||||
}
|
||||
|
||||
/*
|
||||
#toolbar select{
|
||||
/*border:1px solid #68a;*/
|
||||
border:1px solid #68a;
|
||||
border:0;
|
||||
background-color: #37506f;
|
||||
color: #FFF;
|
||||
|
@ -231,7 +232,7 @@ body.inner {
|
|||
#toolbar select:hover{
|
||||
background-color:#68a;
|
||||
}
|
||||
|
||||
*/
|
||||
a.toolbar_btn {
|
||||
width:20px;
|
||||
height:20px;
|
||||
|
|
|
@ -190,7 +190,7 @@ def enhance_torrent_status(torrent_id,status):
|
|||
else:
|
||||
status.action = "stop"
|
||||
|
||||
status.message = (STATE_MESSAGES[status.state])
|
||||
status.message = _(status.state)
|
||||
|
||||
#add some pre-calculated values
|
||||
status.update({
|
||||
|
@ -241,12 +241,13 @@ def get_categories(torrent_list):
|
|||
def filter_torrent_state(torrent_list,filter_name):
|
||||
#redesign filters on status field.
|
||||
filters = {
|
||||
'allocating': lambda t: (t.state == 0),
|
||||
'checking': lambda t: (t.state == 1),
|
||||
'downloading': lambda t: (t.state == 2),
|
||||
'seeding':lambda t: (t.state == 3),
|
||||
'paused':lambda t: (t.state == 4),
|
||||
'error':lambda t: (t.state == 5),
|
||||
'allocating': lambda t: (t.state == 'Allocating'),
|
||||
'checking': lambda t: (t.state == 'Checking'),
|
||||
'downloading': lambda t: (t.state == 'Downloadig'),
|
||||
'seeding':lambda t: (t.state == 'Seeding'),
|
||||
'paused':lambda t: (t.state == 'Paused'),
|
||||
'error':lambda t: (t.state == 'Error'),
|
||||
'queued':lambda t: (t.state == 'Queued'),
|
||||
'traffic':lambda t: (t.download_rate > 0 or t.upload_rate > 0)
|
||||
}
|
||||
filter_func = filters[filter_name]
|
||||
|
@ -266,8 +267,10 @@ def get_category_choosers(torrent_list):
|
|||
(_('Allocating'),'allocating') ,
|
||||
(_('Checking'),'checking') ,
|
||||
(_('Downloading'),'downloading') ,
|
||||
(_('Seeding'),'seeding') ,
|
||||
(_('Paused'),'paused'),
|
||||
(_('Error'),'error'),
|
||||
(_('Queued'),'queued'),
|
||||
(_('Traffic'),'traffic')
|
||||
]:
|
||||
title += ' (%s)' % (
|
||||
|
|
Loading…
Reference in New Issue