summaryrefslogtreecommitdiffstats
path: root/module/web/pyload
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-21 19:59:59 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-21 19:59:59 +0100
commit9453269684b8d17411d8bbc4ecd0c7958670ff42 (patch)
treec44940bb96b054f46d0db279a548de3e278c6e8d /module/web/pyload
parentreverted files, pyload.db fix (diff)
downloadpyload-9453269684b8d17411d8bbc4ecd0c7958670ff42.tar.xz
log view, progressbar test
Diffstat (limited to 'module/web/pyload')
-rw-r--r--module/web/pyload/urls.py1
-rw-r--r--module/web/pyload/views.py13
2 files changed, 12 insertions, 2 deletions
diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py
index 63badeb25..73ba08c21 100644
--- a/module/web/pyload/urls.py
+++ b/module/web/pyload/urls.py
@@ -12,6 +12,7 @@ urlpatterns = patterns('pyload',
(r'^download/(?P<path>[a-zA-z\.0-9\-/_%]+)$', 'views.download',{},'download'),
(r'^queue/$', 'views.queue',{}, 'queue'),
(r'^logs/$', 'views.logs',{}, 'logs'),
+ (r'^logs/(?P<page>\d+)$', 'views.logs',{}, 'logs'),
(r'^$', 'views.home',{}, 'home'),
)
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index 1fa9d45b7..e38a0abf5 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
# Create your views here.
import mimetypes
from django.http import HttpResponse
@@ -136,5 +138,12 @@ def download(request,path):
@login_required
@permission('pyload.user.can_see_logs')
@check_server
-def logs(request):
- return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{},[status_proc])) \ No newline at end of file
+def logs(request, page=0):
+
+ log = file(join(settings.LOG_ROOT, "log.txt")).readlines()
+ data = []
+ page = int(page)
+ for i in range(page, page+20):
+ data.append({'line': i+1 , 'content' :log[i]})
+
+ return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{'log': data, 'next': str(page+20) , 'prev': 0 if page-20 < 0 else page-20},[status_proc])) \ No newline at end of file