diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-21 19:59:59 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-21 19:59:59 +0100 |
commit | 9453269684b8d17411d8bbc4ecd0c7958670ff42 (patch) | |
tree | c44940bb96b054f46d0db279a548de3e278c6e8d /module | |
parent | reverted files, pyload.db fix (diff) | |
download | pyload-9453269684b8d17411d8bbc4ecd0c7958670ff42.tar.xz |
log view, progressbar test
Diffstat (limited to 'module')
-rw-r--r-- | module/web/media/js/jquery.progressbar.js | 10 | ||||
-rw-r--r-- | module/web/pyload/urls.py | 1 | ||||
-rw-r--r-- | module/web/pyload/views.py | 13 | ||||
-rw-r--r-- | module/web/settings.py | 5 | ||||
-rw-r--r-- | module/web/templates/default/base.html | 4 | ||||
-rw-r--r-- | module/web/templates/default/home.html | 7 | ||||
-rw-r--r-- | module/web/templates/default/logs.html | 9 |
7 files changed, 37 insertions, 12 deletions
diff --git a/module/web/media/js/jquery.progressbar.js b/module/web/media/js/jquery.progressbar.js index 93a12d59a..7ddf4a558 100644 --- a/module/web/media/js/jquery.progressbar.js +++ b/module/web/media/js/jquery.progressbar.js @@ -18,22 +18,22 @@ USAGE: progressBar: new function() {
this.defaults = {
- steps : 1, // steps taken to reach target
- step_duration : 1,
+ steps : 20, // steps taken to reach target
+ step_duration : 20,
max : 100, // Upon 100% i'd assume, but configurable
showText : true, // show text with percentage in next to the progressbar? - default : true
textFormat : 'percentage', // Or otherwise, set to 'fraction'
- width : '100%', // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif'
+ width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif'
height : 12, // Height of the progressbar - don't forget to adjust your image too!!!
callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc
- /*boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar
+ boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar
barImage : {
0: '/media/img/progressbg_red.gif',
30: '/media/img/progressbg_orange.gif',
70: '/media/img/progressbg_green.gif'
},
- */
+
// Internal use
running_value : 0,
value : 0,
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 diff --git a/module/web/settings.py b/module/web/settings.py index 894583aa4..13452b4d0 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -20,6 +20,9 @@ sys.path.append(os.path.join(PYLOAD_DIR, "module")) from XMLConfigParser import XMLConfigParser config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml")) +#DEBUG = config.get("general","debug") + + ssl = "" if config.get("ssl", "activated") == "True": @@ -37,7 +40,7 @@ PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) TEMPLATE = config.get('webinterface','template') DL_ROOT = os.path.join(PYLOAD_DIR, config.get('general','download_folder')) - +LOG_ROOT = os.path.join(PYLOAD_DIR, config.get('log','log_folder')) ADMINS = ( # ('Your Name', 'your_email@domain.com'), diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 94d8c3dd2..98858b9df 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -8,7 +8,7 @@ <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css">
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css">
<script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script>
-<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script>
+<!--<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script>-->
<script src="{{ MEDIA_URL }}js/sprintf.js"></script>
<script src="{{ MEDIA_URL }}js/funktions.js"></script>
<script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script>
@@ -67,7 +67,7 @@ function LinksToContent(data) setTimeout(function()
{
$.getJSON('/json/links', LinksToContent );
- }, 4000);
+ }, 1000);
}
</script>
diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index acc185444..58c2c5c79 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -26,11 +26,14 @@ Active Downloads <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#link_{{ link.id }}_pgb').progressBar(50);">load</a></td>
</tr>
<tr>
- <td colspan="5" class="ui-progressbar ui-widget ui-widget-content ui-corner-all">
- <div id="link_{{ link.id }}_pgb" class="ui-progressbar-value ui-widget-header ui-corner-left" style="overflow: hidden; width: {{ link.percent }}%; display: block;"> </div>
+ <td colspan="5">
+
</td>
</tr>
{% endfor %}
+
+ <span id="pb1" class="progressBar">75%</span>
+
<tbody>
</table>
{% endblock %}
\ No newline at end of file diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html index 39f4b8660..f9b0504d9 100644 --- a/module/web/templates/default/logs.html +++ b/module/web/templates/default/logs.html @@ -13,4 +13,13 @@ <li class="right" class="selected"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> +{% endblock %} + +{% block content %} +<ul> +{% for line in log %} + <li>{{line.line}}: {{line.content}}</li> +{% endfor %} +</ul> +<a href="{% url logs %}"><< Start</a> <a href="{% url logs prev %}">< prev</a> <a href="{% url logs next %}">next ></a> {% endblock %}
\ No newline at end of file |