webui:fix TORRENT_STATE

This commit is contained in:
Martijn Voncken 2008-03-04 12:04:08 +00:00
parent 0e31d4243c
commit 985ccb3187
3 changed files with 15 additions and 9 deletions

View File

@ -396,9 +396,11 @@ class daemon_control:
proxy.shutdown() proxy.shutdown()
elif command == 'start': elif command == 'start':
self.start() self.start()
return do_redirect()
elif command == 'restart': elif command == 'restart':
proxy.shutdown() proxy.shutdown()
self.start() self.start()
return do_redirect()
else: else:
raise Exception('Unknown command:"%s"' % command) raise Exception('Unknown command:"%s"' % command)

View File

@ -222,8 +222,9 @@ body.inner {
height:20px; height:20px;
} }
/*
#toolbar select{ #toolbar select{
/*border:1px solid #68a;*/ border:1px solid #68a;
border:0; border:0;
background-color: #37506f; background-color: #37506f;
color: #FFF; color: #FFF;
@ -231,7 +232,7 @@ body.inner {
#toolbar select:hover{ #toolbar select:hover{
background-color:#68a; background-color:#68a;
} }
*/
a.toolbar_btn { a.toolbar_btn {
width:20px; width:20px;
height:20px; height:20px;

View File

@ -190,7 +190,7 @@ def enhance_torrent_status(torrent_id,status):
else: else:
status.action = "stop" status.action = "stop"
status.message = (STATE_MESSAGES[status.state]) status.message = _(status.state)
#add some pre-calculated values #add some pre-calculated values
status.update({ status.update({
@ -241,12 +241,13 @@ def get_categories(torrent_list):
def filter_torrent_state(torrent_list,filter_name): def filter_torrent_state(torrent_list,filter_name):
#redesign filters on status field. #redesign filters on status field.
filters = { filters = {
'allocating': lambda t: (t.state == 0), 'allocating': lambda t: (t.state == 'Allocating'),
'checking': lambda t: (t.state == 1), 'checking': lambda t: (t.state == 'Checking'),
'downloading': lambda t: (t.state == 2), 'downloading': lambda t: (t.state == 'Downloadig'),
'seeding':lambda t: (t.state == 3), 'seeding':lambda t: (t.state == 'Seeding'),
'paused':lambda t: (t.state == 4), 'paused':lambda t: (t.state == 'Paused'),
'error':lambda t: (t.state == 5), 'error':lambda t: (t.state == 'Error'),
'queued':lambda t: (t.state == 'Queued'),
'traffic':lambda t: (t.download_rate > 0 or t.upload_rate > 0) 'traffic':lambda t: (t.download_rate > 0 or t.upload_rate > 0)
} }
filter_func = filters[filter_name] filter_func = filters[filter_name]
@ -266,8 +267,10 @@ def get_category_choosers(torrent_list):
(_('Allocating'),'allocating') , (_('Allocating'),'allocating') ,
(_('Checking'),'checking') , (_('Checking'),'checking') ,
(_('Downloading'),'downloading') , (_('Downloading'),'downloading') ,
(_('Seeding'),'seeding') ,
(_('Paused'),'paused'), (_('Paused'),'paused'),
(_('Error'),'error'), (_('Error'),'error'),
(_('Queued'),'queued'),
(_('Traffic'),'traffic') (_('Traffic'),'traffic')
]: ]:
title += ' (%s)' % ( title += ' (%s)' % (