def set_active_menu(self, menu): application.active_menu = menu if menu.get('params', {}).get('name'): menu_name = menu['params']['name'] else: menu_name = menu['name'] reporter.page_in(menu_name)
def plugin_base(name): reporter.page_in(name) plugin = plugin_manager.plugins.get(name) if not plugin: return "Plugin not found" ui = plugin['beta_web'] web_content = ui.index() soup = BeautifulSoup(web_content, 'html.parser') # set all javascripts into script block all_scripts = [] for javascript_tag in soup.find_all('script'): all_scripts.append(javascript_tag) javascript_tag.extract() # set all css link into header all_css = [] for css_tag in soup.find_all('link'): all_css.append(css_tag) css_tag.extract() return render_template('plugin.html', plugin_content=str(soup), plugin_javascript=all_scripts, plugin_css=all_css)
def index(): reporter.page_in('inspector') return send_file(str(CLIENT_ROOT_DIR / 'index.html'))