diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-16 17:50:36 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-16 17:52:25 +0800 |
commit | cfd21163c06013b0637047382e32527f223973c5 (patch) | |
tree | bf6c6895c66c169f5b5de04024e555681348363e /fg21sim | |
parent | 4c425e1e6e78dc0008d996a77f1dc51f7d4eab0c (diff) | |
download | fg21sim-cfd21163c06013b0637047382e32527f223973c5.tar.bz2 |
webui: Add AJAX handlers "ConfigsAJAXHandler" & "ConsoleAJAXHandler"
NOTE:
These two AJAX handlers are currently not finished!
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/webui/app.py | 10 | ||||
-rw-r--r-- | fg21sim/webui/handlers/__init__.py | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/fg21sim/webui/app.py b/fg21sim/webui/app.py index 9f8092e..9bc7029 100644 --- a/fg21sim/webui/app.py +++ b/fg21sim/webui/app.py @@ -16,7 +16,11 @@ import os import tornado.web from tornado.web import url -from .handlers import IndexHandler, LoginHandler, WSHandler +from .handlers import (IndexHandler, + LoginHandler, + ConfigsAJAXHandler, + ConsoleAJAXHandler, + WSHandler) from .utils import gen_cookie_secret from ..configs import ConfigManager @@ -45,6 +49,8 @@ class Application(tornado.web.Application): handlers = [ url(r"/", IndexHandler, name="index"), url(r"/login", LoginHandler, name="login"), + url(r"/ajax/configs", ConfigsAJAXHandler), + url(r"/ajax/console", ConsoleAJAXHandler), url(r"/ws", WSHandler), ] # Application settings @@ -59,7 +65,7 @@ class Application(tornado.web.Application): "login_url": r"/login", # Secret key used to sign the cookies "cookie_secret": gen_cookie_secret(), - # Enable "cross-site request forgery" (XSRF) + # Enable "cross-site request forgery" (XSRF) protection "xsrf_cookies": True, } settings.update(kwargs) diff --git a/fg21sim/webui/handlers/__init__.py b/fg21sim/webui/handlers/__init__.py index 0eb3818..6fa4152 100644 --- a/fg21sim/webui/handlers/__init__.py +++ b/fg21sim/webui/handlers/__init__.py @@ -3,4 +3,6 @@ from .index import IndexHandler from .login import LoginHandler +from .configs import ConfigsAJAXHandler +from .console import ConsoleAJAXHandler from .websocket import WSHandler |