public PoolsModule(IPoolManager poolManager) : base("/pools") { Get["/"] = _ => View["pools", new PoolsModel { Pools = poolManager.GetAllAsReadOnly() }]; }
public IndexModule(IStatisticsManager statisticsManager, IPoolManager poolManager, IAlgorithmManager algorithmManager) { Get["/"] = _ => { // include common data required by layout. ViewBag.Header = "Welcome"; // return our view return(View["index", new IndexModel { Pools = poolManager.GetAllAsReadOnly(), Algorithms = algorithmManager.GetAllAsReadOnly(), Statistics = statisticsManager }]); }; }
public IndexModule(IStatisticsManager statisticsManager, IPoolManager poolManager, IAlgorithmManager algorithmManager) { Get["/"] = _ => { // include common data required by layout. ViewBag.Header = "Welcome"; // return our view return View["index", new IndexModel { Pools = poolManager.GetAllAsReadOnly(), Algorithms = algorithmManager.GetAllAsReadOnly(), Statistics = statisticsManager }]; }; }
public HelpModule(IPoolManager poolManager, IConfigManager configManager, ISoftwareRepository softwareRepository) : base("/help") { Get["/faq"] = _ => { ViewBag.Header = "Frequently Asked Questions"; return(View["faq"]); }; Get["/gettingstarted/"] = _ => { var model = new GettingStartedModel { Stack = configManager.StackConfig, Pools = poolManager.GetAllAsReadOnly() }; return(View["gettingstarted/index", model]); }; Get["/gettingstarted/pool/{slug}"] = _ => { var pool = poolManager.Get(HttpUtility.HtmlEncode(_.slug)); // find the requested pool. if (pool == null) { return(View["error", new ErrorViewModel { Details = string.Format("The requested pool does not exist: {0}", _.slug) }]); } var model = new GettingStartedPoolModel { Stack = configManager.StackConfig, Pool = pool }; return(View["gettingstarted/pool", model]); }; Get["/miningsoftware/"] = _ => { return(View["miningsoftware", softwareRepository]); }; }
public HelpModule(IPoolManager poolManager, IConfigManager configManager, ISoftwareRepository softwareRepository) : base("/help") { Get["/faq"] = _ => { ViewBag.Header = "Frequently Asked Questions"; return View["faq"]; }; Get["/gettingstarted/"] = _ => { var model = new GettingStartedModel { Stack = configManager.StackConfig, Pools = poolManager.GetAllAsReadOnly() }; return View["gettingstarted/index", model]; }; Get["/gettingstarted/pool/{slug}"] = _ => { var pool = poolManager.Get(HttpUtility.HtmlEncode(_.slug)); // find the requested pool. if (pool == null) { return View["error", new ErrorViewModel { Details = string.Format("The requested pool does not exist: {0}", _.slug) }]; } var model = new GettingStartedPoolModel { Stack = configManager.StackConfig, Pool = pool }; return View["gettingstarted/pool", model]; }; Get["/miningsoftware/"] = _ => { return View["miningsoftware", softwareRepository]; }; }
public IndexModule(IStatisticsManager statisticsManager, IPoolManager poolManager) { Get["/"] = _ => { // include common data required by layout. ViewBag.Heading = "Welcome"; ViewBag.Pools = poolManager; ViewBag.LastUpdate = statisticsManager.LastUpdate.ToString("HH:mm:ss tt zz"); // last statistics update. // return our view return(View["index", new IndexModel { Pools = poolManager.GetAllAsReadOnly(), Statistics = statisticsManager }]); }; }