@ -2952,6 +2952,7 @@ Page.Log = new Class({
name : "log" ,
title : "Show recent logs." ,
has_tab : false ,
navigation : null ,
log_items : [ ] ,
report_text : "### Steps to reproduce:\n" + "1. ..\n" + "2. ..\n" + "\n" + "### Information:\n" + "Movie(s) I have this with: ...\n" + "Quality of the movie being searched: ...\n" + "Providers I use: ...\n" + "Version of CouchPotato: {version}\n" + "Running on: ...\n" + "\n" + "### Logs:\n" + "```\n{issue}```" ,
indexAction : function ( ) {
@ -2969,7 +2970,13 @@ Page.Log = new Class({
}
}
} ) . inject ( self . content ) ;
Api . request ( "logging.get" , {
if ( self . navigation ) {
var nav = self . navigation . getElement ( ".nav" ) ;
nav . getElements ( ".active" ) . removeClass ( "active" ) ;
self . navigation . getElements ( "li" ) [ nr + 1 ] . addClass ( "active" ) ;
}
if ( self . request && self . request . running ) self . request . cancel ( ) ;
self . request = Api . request ( "logging.get" , {
data : {
nr : nr
} ,
@ -2978,7 +2985,9 @@ Page.Log = new Class({
self . log_items = self . createLogElements ( json . log ) ;
self . log . adopt ( self . log_items ) ;
self . log . removeClass ( "loading" ) ;
var navigation = new Element ( "div.navigation" ) . adopt ( new Element ( "h2[text=Logs]" ) , new Element ( "div.hint" , {
self . scrollToBottom ( ) ;
if ( ! self . navigation ) {
self . navigation = new Element ( "div.navigation" ) . adopt ( new Element ( "h2[text=Logs]" ) , new Element ( "div.hint" , {
text : "Select multiple lines & report an issue"
} ) ) ;
var nav = new Element ( "ul.nav" , {
@ -2987,7 +2996,7 @@ Page.Log = new Class({
self . getLogs ( parseInt ( el . get ( "text" ) ) - 1 ) ;
}
}
} ) . inject ( navigation ) ;
} ) . inject ( self . navigation ) ;
new Element ( "li.filter" ) . grab ( new Element ( "select" , {
events : {
change : function ( ) {
@ -3027,8 +3036,8 @@ Page.Log = new Class({
}
}
} ) . inject ( nav ) ;
navigation . inject ( self . content , "top" ) ;
self . scrollToBottom ( ) ;
self . navigation . inject ( self . content , "top" ) ;
}
}
} ) ;
} ,
@ -3048,7 +3057,7 @@ Page.Log = new Class({
return elements ;
} ,
scrollToBottom : function ( ) {
new Fx . Scroll ( this . el , {
new Fx . Scroll ( this . content , {
duration : 0
} ) . toBottom ( ) ;
} ,