From d1e3f6219e1325e32e94de2b0c8189647c3393cb Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 22 Nov 2016 17:55:21 +0800 Subject: webui: Add "ProductsAJAXHandler" to manipulate the products manifest TODO: some actions currently not implemented yet --- fg21sim/webui/app.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fg21sim/webui/app.py') 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: -- cgit v1.2.2