summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
Diffstat (limited to 'module/web')
-rw-r--r--module/web/ajax/views.py4
-rw-r--r--module/web/media/default/img/status_failed.pngbin700 -> 701 bytes
-rw-r--r--module/web/media/default/img/status_offline.png (renamed from module/web/media/default/img/status_aborted.png)bin700 -> 700 bytes
-rw-r--r--module/web/media/default/img/status_proc.pngbin0 -> 512 bytes
-rw-r--r--module/web/media/default/img/status_queue.pngbin0 -> 7613 bytes
-rw-r--r--module/web/pyload/views.py34
-rw-r--r--module/web/templates/default/collector.html4
-rw-r--r--module/web/templates/default/home.html4
-rw-r--r--module/web/templates/default/queue.html4
9 files changed, 42 insertions, 8 deletions
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 2c807f6c9..b1fe2f676 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -108,12 +108,12 @@ def links(request):
ids.append(link['id'])
if link['status'] == 12:
- link['info'] = "%s @ %s kb/s" % (format_time(link['eta']), round(link['speed'], 2))
+ link['info'] = "%s @ %s kb/s" % (link['format_eta'], round(link['speed'], 2))
elif link['status'] == 5:
link['percent'] = 0
link['size'] = 0
link['kbleft'] = 0
- link['info'] = _("waiting %s") % format_time(link['wait_until'] - time.time())
+ link['info'] = _("waiting %s") % link['format_wait']
else:
link['info'] = ""
diff --git a/module/web/media/default/img/status_failed.png b/module/web/media/default/img/status_failed.png
index 0cfd58596..c37bd062e 100644
--- a/module/web/media/default/img/status_failed.png
+++ b/module/web/media/default/img/status_failed.png
Binary files differ
diff --git a/module/web/media/default/img/status_aborted.png b/module/web/media/default/img/status_offline.png
index 0cfd58596..0cfd58596 100644
--- a/module/web/media/default/img/status_aborted.png
+++ b/module/web/media/default/img/status_offline.png
Binary files differ
diff --git a/module/web/media/default/img/status_proc.png b/module/web/media/default/img/status_proc.png
new file mode 100644
index 000000000..67de2c6cc
--- /dev/null
+++ b/module/web/media/default/img/status_proc.png
Binary files differ
diff --git a/module/web/media/default/img/status_queue.png b/module/web/media/default/img/status_queue.png
new file mode 100644
index 000000000..293b13f77
--- /dev/null
+++ b/module/web/media/default/img/status_queue.png
Binary files differ
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]))
diff --git a/module/web/templates/default/collector.html b/module/web/templates/default/collector.html
index b0d5b1839..09725103b 100644
--- a/module/web/templates/default/collector.html
+++ b/module/web/templates/default/collector.html
@@ -121,12 +121,12 @@ document.addEvent("domready", function(){
{% for lid, child in package.links.iteritems %}
<div class="child" id="file_{{lid}}">
<span class="child_status">
- <img src="/media/default/img/status_{{child.status_type}}.png" style="width: 12px; height:12px;"/>
+ <img src="/media/default/img/{{child.icon}}" style="width: 12px; height:12px;"/>
</span>
<span style="font-size: 15px">{{ child.name }}</span><br />
<div class="child_secrow">
<span class="child_status">{{ child.status }}</span>{{child.error}}&nbsp;
- <span class="child_status">{{ child.size }} KB</span>
+ <span class="child_status">{{ child.format_size }}/span>
<span class="child_status">{{ child.plugin }}</span>
<span class="child_status">{% trans "Folder:" %} {{child.folder}}</span>
&nbsp;&nbsp;
diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html
index 76f87b203..b4602f021 100644
--- a/module/web/templates/default/home.html
+++ b/module/web/templates/default/home.html
@@ -171,7 +171,7 @@ var LinkEntry = new Class({
this.elements.name.set('text', item.name);
this.elements.status.set('text', item.statusmsg);
this.elements.info.set('text', item.info);
- this.elements.kbleft.set('text', HumanFileSize(item.size / (1024)));
+ this.elements.kbleft.set('text', item.format_size);
this.elements.percent.set('text', item.percent+ '% / '+ HumanFileSize((item.size-item.kbleft) / (1024)));
this.bar.start({
'width': item.percent,
@@ -210,7 +210,7 @@ var LinkEntry = new Class({
<td id="link_{{ link.id }}_name">{{ link.name }}</td>
<td id="link_{{ link.id }}_status">{{ link.status }}</td>
<td id="link_{{ link.id }}_info">{{ link.info }}</td>
- <td id="link_{{ link.id }}_kbleft">{{ link.size }}</td>
+ <td id="link_{{ link.id }}_kbleft">{{ link.format_size }}</td>
<td>
<font id="link_{{ link.id }}_percent">{{ link.percent }}% /{{ link.kbleft }}</font>
<img id="link_{{ link.id }}_remove" style="vertical-align: middle; margin-right: -20px; margin-left: 5px; margin-top: -2px; cursor:pointer;" src="media/default/img/control_cancel.png"/>
diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html
index 71285ddb8..2ca25e03d 100644
--- a/module/web/templates/default/queue.html
+++ b/module/web/templates/default/queue.html
@@ -109,12 +109,12 @@ document.addEvent("domready", function(){
{% for lid, child in package.links.iteritems %}
<div class="child" id="file_{{lid}}">
<span class="child_status">
- <img src="/media/default/img/status_{{child.status}}.png" style="width: 12px; height:12px;"/>
+ <img src="/media/default/img/{{child.icon}}" style="width: 12px; height:12px;"/>
</span>
<span style="font-size: 15px">{{ child.name }}</span><br />
<div class="child_secrow">
<span class="child_status">{{ child.statusmsg }}</span>{{child.error}}&nbsp;
- <span class="child_status">{{ child.size }} KB</span>
+ <span class="child_status">{{ child.format_size }}</span>
<span class="child_status">{{ child.plugin }}</span>
<span class="child_status">{% trans "Folder:" %} {{package.folder}}</span>
&nbsp;&nbsp;