main page auto refresh

This commit is contained in:
mantaohuang 2020-04-05 19:36:31 -04:00
parent cb86421688
commit 5957bc66f3

View File

@ -15,7 +15,9 @@ om = OManager(session_folder)
class MainHandler(tornado.web.RequestHandler):
def get(self):
buf = f"ops len: {len(om.ops)} <br/>\n"
buf = "<html>\n<head><meta http-equiv=\"refresh\" content=\"5\"></head>\n"
buf += "<body>\n"
buf += f"ops len: {len(om.ops)} <br/>\n"
if len(om.ops):
for idx, op in enumerate(om.ops):
buf += f"op #{idx}, name: {op.name} <br/>\n"
@ -30,6 +32,7 @@ class MainHandler(tornado.web.RequestHandler):
buf += "\nping_stat\n"
buf += "\n".join(op.get_ping_stat().splitlines()[-5:])
buf += "\n</pre>\n"
buf += "</body>\n</html>"
self.write(buf)