... | ... |
@@ -306,7 +306,6 @@ def escape_ansi(line): |
306 | 306 |
def httpReverseLog(numLines): |
307 | 307 |
global server |
308 | 308 |
content="" |
309 |
- #print("Log file:"+server['logfile']) |
|
310 | 309 |
cpt = 0 |
311 | 310 |
content+="<h2>"+server['name']+" Log</h2>\n" |
312 | 311 |
content+="<p>\n<div id=\"latest\"><button class=\"btn-green-menu\" onClick=\"window.location.href='./last';\">Latest</div>\n" |
... | ... |
@@ -326,7 +325,8 @@ def httpReverseLog(numLines): |
326 | 325 |
content+=lineColor+"<br>\n" |
327 | 326 |
|
328 | 327 |
if cpt >= numLines: |
329 |
- continue |
|
328 |
+ break |
|
329 |
+ #continue |
|
330 | 330 |
|
331 | 331 |
content+="</div>\n" |
332 | 332 |
return content |
... | ... |
@@ -441,7 +441,7 @@ class MyServer(BaseHTTPRequestHandler): |
441 | 441 |
self.end_headers() |
442 | 442 |
self.wfile.write(content.encode('utf-8')) |
443 | 443 |
|
444 |
- elif self.path == "/log" or self.path == "/log/" or self.path == "/log/index.html": |
|
444 |
+ elif self.path == "/log" or self.path == "/log/" or self.path == "/log/index.html" or "/log/?" in self.path: |
|
445 | 445 |
uriObject = urlparse(self.path) |
446 | 446 |
queries = uriObject.query.split('&') |
447 | 447 |
uriParams = {} |
... | ... |
@@ -454,7 +454,7 @@ class MyServer(BaseHTTPRequestHandler): |
454 | 454 |
pass |
455 | 455 |
|
456 | 456 |
try: |
457 |
- numLines=uriParams['last'] |
|
457 |
+ numLines=int(uriParams['last']) |
|
458 | 458 |
except: |
459 | 459 |
numLines = 50 |
460 | 460 |
|