summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-04-07 16:19:00 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-04-07 16:19:00 +0200
commit98d6824b47f34597a0486fd41963863037cb294d (patch)
tree7a20da6fadea36850c92d947a49d011e7314938b /module/web
parentul fix (diff)
downloadpyload-98d6824b47f34597a0486fd41963863037cb294d.tar.xz
information page for webif
Diffstat (limited to 'module/web')
-rw-r--r--module/web/media/default/css/default.css19
-rw-r--r--module/web/media/default/img/user-info.pngbin0 -> 3963 bytes
-rw-r--r--module/web/pyload_app.py23
-rw-r--r--module/web/templates/default/base.html1
-rw-r--r--module/web/templates/default/info.html46
5 files changed, 85 insertions, 4 deletions
diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css
index e3f3a4e46..978aeadde 100644
--- a/module/web/media/default/css/default.css
+++ b/module/web/media/default/css/default.css
@@ -248,6 +248,11 @@ a.action.recent {
a.logout {
background:transparent url(/media/default/img/user-actions-logout.png) 0px 1px no-repeat;
}
+
+a.info {
+ background:transparent url(/media/default/img/user-info.png) 0px 1px no-repeat;
+}
+
a.admin {
background:transparent url(/media/default/img/user-actions-admin.png) 0px 1px no-repeat;
}
@@ -887,3 +892,17 @@ ul.nav ul ul {
background:url(/media/default/img//notice.png) no-repeat #000 7px 10px;
width:280px;
}
+
+table.system {
+ border: none;
+ margin-left: 10px;
+}
+
+table.system td {
+ border: none
+}
+
+table.system tr > td:first-child {
+ font-weight: bold;
+ padding-right: 10px;
+} \ No newline at end of file
diff --git a/module/web/media/default/img/user-info.png b/module/web/media/default/img/user-info.png
new file mode 100644
index 000000000..6e643100f
--- /dev/null
+++ b/module/web/media/default/img/user-info.png
Binary files differ
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py
index 179cf4cfc..a71232f2b 100644
--- a/module/web/pyload_app.py
+++ b/module/web/pyload_app.py
@@ -24,16 +24,14 @@ import os
import time
from os import listdir
-from os.path import isdir
-from os.path import isfile
-from os.path import join
+from os.path import isdir, isfile, join ,abspath
from sys import getfilesystemencoding
from hashlib import sha1
from urllib import unquote
from bottle import route, static_file, request, response, redirect, HTTPError, error
-from webinterface import PYLOAD, PROJECT_DIR, SETUP
+from webinterface import PYLOAD, PYLOAD_DIR, PROJECT_DIR, SETUP
from utils import render_to_response, parse_permissions, parse_userdata, login_required, get_permission, set_permission
from filters import relpath, unquotepath
@@ -510,3 +508,20 @@ def setup():
return base([_("Run pyLoadCore.py -s to access the setup.")])
return render_to_response('setup.html', {"user" : False, "perms": False})
+
+@route("/info")
+def info():
+
+ conf = PYLOAD.get_config()
+
+ data = {}
+ data["version"] = PYLOAD.get_server_version()
+ data["folder"] = abspath(PYLOAD_DIR)
+ data["config"] = abspath("")
+ data["download"] = abspath(conf["general"]["download_folder"]["value"])
+ data["remote"] = conf["remote"]["port"]["value"]
+ data["webif"] = conf["webinterface"]["port"]["value"]
+ data["language"] = conf["general"]["language"]["value"]
+
+
+ return render_to_response("info.html", data, [pre_processor]) \ No newline at end of file
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html
index 323f38b66..7f7db2610 100644
--- a/module/web/templates/default/base.html
+++ b/module/web/templates/default/base.html
@@ -231,6 +231,7 @@ function AddBox()
{% if user.is_admin %}
<li><a href="/admin" class="action profile" rel="nofollow">{{_("Administrate")}}</a></li>
{% endif %}
+ <li><a href="/info" class="action info" rel="nofollow">{{_("Info")}}</a></li>
</ul>
{% else %}
diff --git a/module/web/templates/default/info.html b/module/web/templates/default/info.html
new file mode 100644
index 000000000..d1acb804c
--- /dev/null
+++ b/module/web/templates/default/info.html
@@ -0,0 +1,46 @@
+{% extends 'default/base.html' %}
+
+{% block title %}{{ _("Information") }} - {{ super() }} {% endblock %}
+{% block subtitle %}{{ _("Information") }}{% endblock %}
+
+
+{% block content %}
+ <h3>{{ _("News") }}</h3>
+ <div id="twitter">
+ <ul id="twitter_update_list"></ul>
+ <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
+ <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/pyLoad.json?callback=twitterCallback2&count=6"></script>
+ </div>
+ <h3>{{ _("System") }}</h3>
+ <table class="system">
+ <tr>
+ <td>Version:</td>
+ <td>{{ version }}</td>
+ </tr>
+ <tr>
+ <td>Installation Folder:</td>
+ <td>{{ folder }}</td>
+ </tr>
+ <tr>
+ <td>Config Folder:</td>
+ <td>{{ config }}</td>
+ </tr>
+ <tr>
+ <td>Download Folder:</td>
+ <td>{{ download }}</td>
+ </tr>
+ <tr>
+ <td>Language:</td>
+ <td>{{ language }}</td>
+ </tr>
+ <tr>
+ <td>Webinterface Port:</td>
+ <td>{{ webif }}</td>
+ </tr>
+ <tr>
+ <td>Remote Interface Port:</td>
+ <td>{{ remote }}</td>
+ </tr>
+ </table>
+
+{% endblock %} \ No newline at end of file