def json(cls, handler, response=""): request = handler.request if not Transaction.get_root(request): return "" TransactionNode.trim_data(request) result = {} for instance in cls.instances.values(): panel = instance.get_json_panel(handler.request) result[panel['id']] = panel response_panel_raw = cls.get_response_raw_data(handler, response) response_panel_json = {'name': 'response', 'id': 'response', 'content': response_panel_raw} result['response'] = response_panel_json return json.dumps(result)
def render(cls, handler, response=""): """ 渲染页面 """ request = handler.request if not Transaction.get_root(request): return "" TransactionNode.trim_data(request) panels = [instance.get_panel(request) for instance in cls.instances.values()] response_raw_data = cls.get_response_raw_data(handler, response) panels.append(cls.get_response_panel(response_raw_data)) template = jinja_env.get_template('index.html') return template.render(panels=panels)
def render(cls, handler, response=""): """ 渲染页面 """ request = handler.request if not Transaction.get_root(request): return "" TransactionNode.trim_data(request) panels = [ instance.get_panel(request) for instance in cls.instances.values() ] response_raw_data = cls.get_response_raw_data(handler, response) panels.append(cls.get_response_panel(response_raw_data)) template = jinja_env.get_template('index.html') return template.render(panels=panels)
def json(cls, handler, response=""): request = handler.request if not Transaction.get_root(request): return "" TransactionNode.trim_data(request) result = {} for instance in cls.instances.values(): panel = instance.get_json_panel(handler.request) result[panel['id']] = panel response_panel_raw = cls.get_response_raw_data(handler, response) response_panel_json = { 'name': 'response', 'id': 'response', 'content': response_panel_raw } result['response'] = response_panel_json return json.dumps(result)