aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/app.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-16 17:50:36 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-16 17:52:25 +0800
commitcfd21163c06013b0637047382e32527f223973c5 (patch)
treebf6c6895c66c169f5b5de04024e555681348363e /fg21sim/webui/app.py
parent4c425e1e6e78dc0008d996a77f1dc51f7d4eab0c (diff)
downloadfg21sim-cfd21163c06013b0637047382e32527f223973c5.tar.bz2
webui: Add AJAX handlers "ConfigsAJAXHandler" & "ConsoleAJAXHandler"
NOTE: These two AJAX handlers are currently not finished!
Diffstat (limited to 'fg21sim/webui/app.py')
-rw-r--r--fg21sim/webui/app.py10
1 files changed, 8 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)