File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ No server side code is required - it's all just static
1111files - and all modern web servers support Range (tested lighttpd, cherokee,
1212apache). Tested (briefly) in IE, FF, Chrome.
1313
14- Usage: symlink the log to /log, or alter the url in logtail.js. Other settings
15- available in logtail.js including poll frequency. Then browse to index.html
14+ Usage: symlink the log to /log, provide ?url=http://my.custom.path/log , or alter
15+ the url in logtail.js. Other settings available in logtail.js including poll
16+ frequency. Then browse to index.html
1617
1718License is GNU GPL 3; see http://www.gnu.org/licenses/
1819
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ var dataelem = "#data";
77var pausetoggle = "#pause" ;
88var scrollelems = [ "html" , "body" ] ;
99
10- var url = "log" ;
10+ var url_string = window . location . href ;
11+ var urlObject = new URL ( url_string ) ;
12+ var urlParam = urlObject . searchParams . get ( "url" ) ;
13+ var url = urlParam ?? "log"
1114var fix_rn = true ;
1215var load = 30 * 1024 ; /* 30KB */
1316var poll = 1000 ; /* 1s */
@@ -146,7 +149,7 @@ function show_log() {
146149 if ( reverse ) {
147150 var t_a = t . split ( / \n / g) ;
148151 t_a . reverse ( ) ;
149- if ( t_a [ 0 ] == "" )
152+ if ( t_a [ 0 ] == "" )
150153 t_a . shift ( ) ;
151154 t = t_a . join ( "\n" ) ;
152155 }
@@ -163,7 +166,7 @@ function error(what) {
163166 kill = true ;
164167
165168 $ ( dataelem ) . text ( "An error occured :-(.\r\n" +
166- "Reloading may help; no promises.\r\n" +
169+ "Reloading may help; no promises.\r\n" +
167170 what ) ;
168171 scroll ( 0 ) ;
169172
You can’t perform that action at this time.
0 commit comments