public IActionResult Panel(string id, bool split) { if (engine == null) { return(View("Error", "Nodes Engine is not started.<br/><br/> <a href='/Config'>Check settings</a>")); } ViewBag.split = split; if (id == null || id == MAIN_PANEL_ID) { return(RedirectToAction("Index")); } PanelNode panel = engine.GetPanelNode(id); if (panel == null) { return(HttpNotFound()); } ViewBag.panelId = panel.Id; ViewBag.ownerPanelId = panel.PanelId; //create menu stack List <PanelNode> panelsStack = new List <PanelNode>(); bool findNext = true; while (findNext) { panelsStack.Add(panel); if (panel.PanelId == MAIN_PANEL_ID) { findNext = false; } else { panel = engine.GetPanelNode(panel.PanelId); } } panelsStack.Reverse(); ViewBag.panelsStack = panelsStack; ViewBag.Theme = SystemController.nodeEditorConfig.Theme; return(View("Index")); }
public async Task <string> SerializePanel(string id) { return(await Task.Run(() => { if (engine == null) { return null; } PanelNode node = engine.GetPanelNode(id); if (node == null) { return null; } return NodesEngineSerializer.SerializePanel(id, engine); })); }