public IActionResult Panel(string id) { if (engine == null) { return(BadRequest()); } if (id == null || id == MAIN_PANEL_ID) { id = MAIN_PANEL_ID; ViewBag.panelName = "Main Panel"; } else { PanelNode panel = engine.GetPanel(id); if (panel == null) { return(NotFound()); } ViewBag.panelName = panel.Settings["Name"].Value; } ViewBag.panelId = id; return(View("Index")); }
public async Task <string> GetNameForPanel(string id) { return(await Task.Run(() => { if (engine == null) { return null; } PanelNode panel = engine.GetPanel(id); return panel?.Settings["Name"].Value; })); }