diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-04 17:59:44 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-04 17:59:44 +0200 |
commit | b0cb9d0487cb19988db515aea52f22b92423ebaa (patch) | |
tree | 39e7ab111053d19be7d3e9e152be59ed4452690c /module/web/pyload | |
parent | some fixes (diff) | |
download | pyload-b0cb9d0487cb19988db515aea52f22b92423ebaa.tar.xz |
better output formatting, somefixes
Diffstat (limited to 'module/web/pyload')
-rw-r--r-- | module/web/pyload/views.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index d75b7a485..b93ed603e 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -81,6 +81,23 @@ def home(request): @check_server def queue(request): queue = settings.PYLOAD.get_queue() + for package in queue.itervalues(): + for pyfile in package["links"].itervalues(): + if pyfile["status"] == 0: + pyfile["icon"] = "status_finished.png" + elif pyfile["status"] in (2,3): + pyfile["icon"] = "status_queue.png" + elif pyfile["status"] in (9,1): + pyfile["icon"] = "status_offline.png" + elif pyfile["status"] == 5: + pyfile["icon"] = "status_waiting.png" + elif pyfile["status"] == 8: + pyfile["icon"] = "status_failed.png" + elif pyfile["status"] in (11,13): + pyfile["icon"] = "status_proc.png" + else: + pyfile["icon"] = "status_downloading.png" + return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) @@ -172,6 +189,23 @@ def logs(request, page=0): @check_server def collector(request): queue = settings.PYLOAD.get_collector() + for package in queue.itervalues(): + for pyfile in package["links"].itervalues(): + if pyfile["status"] == 0: + pyfile["icon"] = "status_finished.png" + elif pyfile["status"] in (2,3): + pyfile["icon"] = "status_queue.png" + elif pyfile["status"] in (9,1): + pyfile["icon"] = "status_offline.png" + elif pyfile["status"] == 5: + pyfile["icon"] = "status_waiting.png" + elif pyfile["status"] == 8: + pyfile["icon"] = "status_failed.png" + elif pyfile["status"] in (11,13): + pyfile["icon"] = "status_proc.png" + else: + pyfile["icon"] = "status_downloading.png" + return render_to_response(join(settings.TEMPLATE, 'collector.html'), RequestContext(request, {'content': queue}, [status_proc])) |