aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/app.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-22 17:55:21 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-22 17:55:21 +0800
commitd1e3f6219e1325e32e94de2b0c8189647c3393cb (patch)
tree4d920777e6c5e118b2af66896d93ec3782eae1d0 /fg21sim/webui/app.py
parentbc77803e4d72ec51f7c57ac09c2e131247adccaa (diff)
downloadfg21sim-d1e3f6219e1325e32e94de2b0c8189647c3393cb.tar.bz2
webui: Add "ProductsAJAXHandler" to manipulate the products manifest
TODO: some actions currently not implemented yet
Diffstat (limited to 'fg21sim/webui/app.py')
-rw-r--r--fg21sim/webui/app.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/fg21sim/webui/app.py b/fg21sim/webui/app.py
index ba27222..972771c 100644
--- a/fg21sim/webui/app.py
+++ b/fg21sim/webui/app.py
@@ -18,9 +18,11 @@ from .handlers import (IndexHandler,
LoginHandler,
ConfigsAJAXHandler,
ConsoleAJAXHandler,
+ ProductsAJAXHandler,
WSHandler)
from .utils import gen_cookie_secret
from ..configs import ConfigManager
+from ..products import Products
# Each module defines its own options, which are added to the global namespace
@@ -52,6 +54,8 @@ class Application(tornado.web.Application):
2. running=False, finished=True: finished
3. running=True, finished=False: running
4. running=True, finished=True: ?? error ??
+ products : `~fg21sim.products.Products`
+ Manage and manipulate the simulation products
"""
def __init__(self, **kwargs):
@@ -59,12 +63,14 @@ class Application(tornado.web.Application):
self.websockets = set()
self.executor = ThreadPoolExecutor(max_workers=options.max_workers)
self.task_status = {"running": False, "finished": False}
+ self.products = Products()
# URL handlers
handlers = [
url(r"/", IndexHandler, name="index"),
url(r"/login", LoginHandler, name="login"),
url(r"/ajax/configs", ConfigsAJAXHandler),
url(r"/ajax/console", ConsoleAJAXHandler),
+ url(r"/ajax/products", ProductsAJAXHandler),
url(r"/ws", WSHandler),
]
if options.debug: