summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 00:47:41 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 00:47:41 +0200
commitd6f160876cca336469d2fd047486b8520d3ab3d7 (patch)
tree2750cfc92d1642566b7e6433c3bcef015f48b215
parentMerge pull request #7 from ardi69/0.4.10 (diff)
parentadded: colred logs for webui to (currently only for theme "Next") (diff)
downloadpyload-d6f160876cca336469d2fd047486b8520d3ab3d7.tar.xz
Merge pull request #8 from ardi69/0.4.10
colored logs for webui to
-rw-r--r--pyload/plugin/internal/MultiHook.py2
-rw-r--r--pyload/webui/app/pyloadweb.py6
-rw-r--r--pyload/webui/themes/Next/css/log.css40
-rw-r--r--pyload/webui/themes/Next/tml/logs.html2
4 files changed, 46 insertions, 4 deletions
diff --git a/pyload/plugin/internal/MultiHook.py b/pyload/plugin/internal/MultiHook.py
index f48ae0909..8140e2431 100644
--- a/pyload/plugin/internal/MultiHook.py
+++ b/pyload/plugin/internal/MultiHook.py
@@ -70,7 +70,7 @@ class MultiHook(Hook):
def initPlugin(self):
self.pluginname = self.__class__.__name__
- plugin, self.plugintype = self.core.pluginManager.findPlugin(("hoster", "decrypter", "container"), self.pluginname)
+ plugin, self.plugintype = self.core.pluginManager.findPlugin(("hoster", "crypter", "container"), self.pluginname)
if plugin:
self.pluginmodule = self.core.pluginManager.loadModule(self.plugintype, self.pluginname)
diff --git a/pyload/webui/app/pyloadweb.py b/pyload/webui/app/pyloadweb.py
index 0d4bbfe51..b3baed3eb 100644
--- a/pyload/webui/app/pyloadweb.py
+++ b/pyload/webui/app/pyloadweb.py
@@ -399,6 +399,7 @@ def logs(item=-1):
warning = ""
conf = PYLOAD.getConfigValue("log", "file_log")
+ color_template = PYLOAD.getConfigValue("log", "color_template") if PYLOAD.getConfigValue("log", "color_console") else ""
if not conf:
warning = "Warning: File log is disabled, see settings page."
@@ -445,7 +446,7 @@ def logs(item=-1):
if counter >= item:
try:
date, time, level, message = l.decode("utf8", "ignore").split(" ", 3)
- dtime = datetime.strptime(date + ' ' + time, '%d.%m.%Y %H:%M:%S')
+ dtime = datetime.strptime(date + ' ' + time, '%Y-%m-%d %H:%M:%S')
except Exception:
dtime = None
date = '?'
@@ -469,7 +470,8 @@ def logs(item=-1):
return render_to_response('logs.html', {'warning': warning, 'log': data, 'from': fro.strftime('%d.%m.%Y %H:%M:%S'),
'reversed': reversed, 'perpage': perpage, 'perpage_p': sorted(perpage_p),
'iprev': 1 if item - perpage < 1 else item - perpage,
- 'inext': (item + perpage) if item + perpage < len(log) else item},
+ 'inext': (item + perpage) if item + perpage < len(log) else item,
+ 'color_template': color_template},
[pre_processor])
diff --git a/pyload/webui/themes/Next/css/log.css b/pyload/webui/themes/Next/css/log.css
index af2ea4fe8..71ba01edb 100644
--- a/pyload/webui/themes/Next/css/log.css
+++ b/pyload/webui/themes/Next/css/log.css
@@ -51,6 +51,46 @@ td.loglevel
{
text-align:right;
}
+td.mixedDEBUG, td.lineDEBUG, td.loglevellineDEBUG
+{
+ color: darkcyan;
+}
+td.mixedWARNING, td.lineWARNING, td.loglevellineWARNING
+{
+ color: #660;
+}
+td.mixedERROR, td.lineERROR, td.loglevellineERROR
+{
+ color: red;
+}
+td.mixedCRITICAL, td.lineCRITICAL, td.loglevellineCRITICAL
+{
+ color: purple;
+}
+td.loglevelmixedDEBUG span, td.loglevellabelDEBUG span
+{
+ font-weight: bold;
+ color: white;
+ background-color: darkcyan;
+}
+td.loglevelmixedWARNING span, td.loglevellabelWARNING span
+{
+ font-weight: bold;
+ color: white;
+ background-color: #660;
+}
+td.loglevelmixedERROR span, td.loglevellabelERROR span
+{
+ font-weight: bold;
+ color: white;
+ background-color: red;
+}
+td.loglevelmixedCRITICAL span, td.loglevellabelCRITICAL span
+{
+ font-weight: bold;
+ color: white;
+ background-color: purple;
+}
.logperpage
{
float: right;
diff --git a/pyload/webui/themes/Next/tml/logs.html b/pyload/webui/themes/Next/tml/logs.html
index 8e995c465..f0f25a9dd 100644
--- a/pyload/webui/themes/Next/tml/logs.html
+++ b/pyload/webui/themes/Next/tml/logs.html
@@ -27,7 +27,7 @@
<div class="logdiv">
<table class="logtable" cellpadding="0" cellspacing="0">
{% for line in log %}
- <tr><td class="logline">{{line.line}}</td><td>{{line.date}}</td><td class="loglevel">{{line.level}}</td><td>{{line.message}}</td></tr>
+ <tr><td class="logline">{{line.line}}</td><td class="{{color_template}}{{line.level}}">{{line.date}}</td><td class="loglevel loglevel{{color_template}}{{line.level}}"><span>{{line.level}}</span></td><td class="{{color_template}}{{line.level}}">{{line.message}}</td></tr>
{% endfor %}
</table>
</div>