diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index 7f687763..118830c9 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -35,7 +35,7 @@ %> - ${artist['ArtistName']} + ${artist['ArtistName']} ${artist['LatestAlbum']} ${releasedate}
${havetracks}/${totaltracks}
@@ -57,7 +57,7 @@ $('#artist_table').dataTable( { "aoColumns": [ - { "sType": "anti-the" }, + { "sType": "title-string"}, null, null, { "sType": "title-numeric"} diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index c1dacc9c..c4525033 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -1,4 +1,7 @@ <%inherit file="base.html"/> +<%! + from headphones import helpers +%> <%def name="body()"> @@ -13,17 +16,14 @@ %for line in lineList: <% - from headphones import helpers out_tuple = helpers.extract_logline(line) - if out_tuple: - timestamp, level, thread, message = out_tuple %> - %if timestamp and level and thread and message: + %if out_tuple: - - - - + + + + %endif %endfor diff --git a/data/js/plugins.js b/data/js/plugins.js index 272d679b..7db34fad 100755 --- a/data/js/plugins.js +++ b/data/js/plugins.js @@ -6,6 +6,18 @@ window.log = function(){ }; (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{}); +jQuery.fn.dataTableExt.oSort['title-string-asc'] = function(a,b) { + var x = a.match(/title="(.*?)"/)[1].toLowerCase(); + var y = b.match(/title="(.*?)"/)[1].toLowerCase(); + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); +}; + +jQuery.fn.dataTableExt.oSort['title-string-desc'] = function(a,b) { + var x = a.match(/title="(.*?)"/)[1].toLowerCase(); + var y = b.match(/title="(.*?)"/)[1].toLowerCase(); + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); +}; + jQuery.fn.dataTableExt.oSort['title-numeric-asc'] = function(a,b) { var x = a.match(/title="*(-?[0-9]+)/)[1]; var y = b.match(/title="*(-?[0-9]+)/)[1]; diff --git a/headphones/webserve.py b/headphones/webserve.py index 765f6570..4c76a26a 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -403,7 +403,7 @@ class WebInterface(object): lineList = fileHandle.readlines() fileHandle.close() lineList.reverse() - return serve_template(templatename="logs.html", title="Log", lineList=lineList[0:1000]) + return serve_template(templatename="logs.html", title="Log", lineList=lineList[0:500]) logs.exposed = True def clearhistory(self):
${timestamp}${level}${thread}${message.decode('utf-8')}${out_tuple[0]}${out_tuple[1]}${out_tuple[2]}${out_tuple[3].decode('utf-8')}