diff options
Diffstat (limited to 'module/web/pyload/views.py')
-rw-r--r-- | module/web/pyload/views.py | 54 |
1 files changed, 9 insertions, 45 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index dd367f7f3..e1f4e2fdd 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -86,31 +86,10 @@ def home(request): @permission('pyload.can_see_dl') @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" - + queue = settings.PYLOAD.get_queue_info() + data = zip(queue.keys(), queue.values()) data.sort(key=get_sort_key) - - for id, value in data: - tmp = zip(value["links"].keys(), value["links"].values()) - tmp.sort(key=get_sort_key) - value["links"] = tmp return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': data}, [status_proc])) @@ -262,31 +241,10 @@ def logs(request, item=-1): @permission('pyload.can_add_dl') @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" + queue = settings.PYLOAD.get_collector_info() data = zip(queue.keys(), queue.values()) data.sort(key=get_sort_key) - - for id, value in data: - tmp = zip(value["links"].keys(), value["links"].values()) - tmp.sort(key=get_sort_key) - value["links"] = tmp return render_to_response(join(settings.TEMPLATE, 'collector.html'), RequestContext(request, {'content': data}, [status_proc])) @@ -371,3 +329,9 @@ def config(request): accs = settings.PYLOAD.get_accounts() return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {'Plugin':plugin, 'General':conf, 'Accounts': accs}, 'errors': messages}, [status_proc])) + +@login_required +@permission('pyload.can_change_status') +@check_server +def package_ui(request): + return render_to_response(join(settings.TEMPLATE, 'package_ui.js'), RequestContext(request, {}, ))
\ No newline at end of file |